Updated Logger and message handler. Updated to latest Discord.Net version

This commit is contained in:
2023-01-01 21:55:29 +02:00
parent 4a5e0ef2f3
commit 69d99b4189
11 changed files with 108 additions and 65 deletions

View File

@@ -66,7 +66,9 @@ internal class Boot
AlwaysDownloadUsers = true,
//Disable system clock checkup (for responses at slash commands)
UseInteractionSnowflakeDate = false
UseInteractionSnowflakeDate = false,
GatewayIntents = GatewayIntents.All
};
client = new DiscordSocketClient(config);

View File

@@ -30,6 +30,7 @@ internal class CommandHandler
this.client = client;
this.commandService = commandService;
this.botPrefix = botPrefix;
}
/// <summary>
@@ -76,12 +77,13 @@ internal class CommandHandler
{
try
{
if (Message.Author.IsBot) return;
if (Message as SocketUserMessage == null)
return;
var message = Message as SocketUserMessage;
if (message == null)
if (message is null)
return;
if (!message.Content.StartsWith(botPrefix))
@@ -95,9 +97,6 @@ internal class CommandHandler
return;
}
if (message.Author.IsBot)
return;
var context = new SocketCommandContext(client, message);
await commandService.ExecuteAsync(context, argPos, null);