BanAPI Documentation
This documentation is relatively the same for v2.0.0 of the SentinelAPI, however to index/call a method properly in the BanAPI you must call it as SentinelAPI.BanAPI:method(...), an example would be: SentinelAPI.BanAPI:BanAsync(...)
This document provides an in-depth overview of the SentinelAPI module, which serves as the backbone for managing bans, unbans, and other moderation-related features in Sentinel. The API interacts with Roblox services and Sentinel Open Cloud API endpoints to enforce moderation effectively.
Module Overview
Dependencies:
Config: Configuration settings for Sentinel.Types: Type definitions used across Sentinel.Enum: Enum definitions for ban types and lengths.RichBan: Helper functions for advanced ban features.
SentinelAPI Methods
1. BanAsync
Bans a player from the experience.
Signature:
function BanAsync(Player: Player, BanConfig: types.BanConfig): booleanParameters:
Player: ThePlayerinstance to ban.BanConfig: A table with configuration details (seeBanConfigtype).
Returns:
boolean - Whether the ban was successful.
Example:
2. OfflineBanAsync
Bans a user by their UserId, even if they are offline.
Signature:
Parameters:
UserId: The Roblox UserId to ban.BanConfig: A table with ban details (seeBanConfigtype).
Returns:
boolean - Whether the ban was successful.
3. BatchBanAsync
Bans multiple players at once.
Signature:
Parameters:
PlayerList: A list ofPlayerinstances to ban.BanConfig: Ban configuration details.
Returns:
boolean: Whether all bans were successful.number: Count of successful bans.number: Count of failed bans.
4. BatchOfflineBanAsync
Bans multiple users by their UserIds.
Signature:
Parameters:
UserIds: List of UserIds to ban.BanConfig: Ban configuration details.
Returns:
boolean: Whether all bans were successful.number: Count of successful bans.number: Count of failed bans.
5. UnbanAsync
Unbans a user by their UserId.
Signature:
Parameters:
UserId: The UserId to unban.Reason: Reason for the unban.
Returns:
boolean - Whether the unban was successful.
6. IsPlayerBanned
Checks if a player is banned.
Signature:
Parameters:
Player: ThePlayerinstance to check.
Returns:
boolean - Whether the player is banned.
7. IsUserIdBanned
Checks if a UserId is banned.
Signature:
Parameters:
UserId: The UserId to check.
Returns:
boolean - Whether the UserId is banned.
8. GetPendingBans
Retrieves the list of pending bans.
Signature:
Returns:
types.BanList?: A list of pending bans ornilif an error occurs.
9. GetPendingUnbans
Retrieves the list of pending unbans.
Signature:
Returns:
types.BanList?: A list of pending unbans ornilif an error occurs.
10. ProccessPendingBans
Processes all pending bans and applies them.
Signature:
11. ProccessPendingUnbans
Processes all pending unbans and applies them.
Signature:
12. ReplicateUpdatedBan
Updates and replicates a ban.
Signature:
Parameters:
UserId: The UserId to update the ban for.BanConfig: Updated ban configuration.
Returns:
boolean - Whether the update was successful.
Error Handling
Errors during API calls (e.g., HTTP requests) are logged with warn statements when Config.DEBUG_INFO_ENABLED is true. Developers should monitor the output for warnings if operations fail.
Example Workflow
Ban a player temporarily:
Unban a player:
Process all pending bans:
Last updated
Was this helpful?