Class BridgeBanService
- Namespace
- FishMMO.DiscordBot.Services
- Assembly
- FishMMO-DiscordBot.dll
Manages bridge bans — prevents specific game characters or accounts from having their messages forwarded between Discord and the game.
public class BridgeBanService
- Inheritance
-
BridgeBanService
- Inherited Members
Constructors
BridgeBanService(BotConfigurationService, ILogger<BridgeBanService>)
Initializes a new instance of the BridgeBanService class.
public BridgeBanService(BotConfigurationService botConfigService, ILogger<BridgeBanService> logger)
Parameters
botConfigServiceBotConfigurationServiceloggerILogger<BridgeBanService>
Methods
AddBridgeBan(string, bool, string, string)
Adds a bridge ban for the specified name.
public bool AddBridgeBan(string name, bool isAccountBan, string bannedBy, string reason)
Parameters
namestringThe character or account name to ban.
isAccountBanboolTrue if this bans an account name; false for character name.
bannedBystringWho issued the ban.
reasonstringReason for the ban.
Returns
- bool
True if the ban was added; false if already banned.
GetAllBans()
Returns all current bridge bans.
public IReadOnlyCollection<BridgeBanEntry> GetAllBans()
Returns
IsBridgeBanned(string?, string?)
Checks whether a character name or account name is bridge-banned.
public bool IsBridgeBanned(string? characterName, string? accountName)
Parameters
Returns
- bool
True if either the character or account is bridge-banned.
RemoveBridgeBan(string)
Removes a bridge ban for the specified name.
public bool RemoveBridgeBan(string name)
Parameters
namestringThe character or account name to unban.
Returns
- bool
True if the ban was removed; false if not found.