mirror of
https://github.com/tribufu/ServerManagers
synced 2026-05-06 15:17:34 +00:00
Changed the discord bot to be case insensitive.
Added IsEmpty and HasOne IEnumerable Extensions.
This commit is contained in:
parent
734332f10c
commit
dd431e93b2
20 changed files with 383 additions and 107 deletions
|
|
@ -72,6 +72,7 @@ namespace ServerManagerTool.DiscordBot
|
|||
// Force all commands to run async
|
||||
DefaultRunMode = RunMode.Async,
|
||||
LogLevel = LogLevelHelper.GetLogSeverity(logLevel),
|
||||
CaseSensitiveCommands = false,
|
||||
};
|
||||
|
||||
var discordBotConfig = new DiscordBotConfig
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ namespace ServerManagerTool.DiscordBot.Services
|
|||
|
||||
// Check if the message has a valid command prefix
|
||||
var argPos = 0;
|
||||
if (msg.HasStringPrefix(_config["DiscordSettings:Prefix"], ref argPos) || msg.HasMentionPrefix(_discord.CurrentUser, ref argPos))
|
||||
if (msg.HasStringPrefix(_config["DiscordSettings:Prefix"], ref argPos, StringComparison.OrdinalIgnoreCase) || msg.HasMentionPrefix(_discord.CurrentUser, ref argPos))
|
||||
{
|
||||
if (LogLevel.Debug.ToString().Equals(_config["DiscordSettings:LogLevel"]))
|
||||
await _logger?.OnLogAsync(new LogMessage(LogSeverity.Debug, MessageSource.System.ToString(), $"Message prefix matched, message will be processed."));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue