forked from TeamInklings/Octobot
Optimize event handlers until we update to .NET 7
This commit is contained in:
parent
29c2332ad9
commit
917e7e5775
1 changed files with 12 additions and 10 deletions
|
@ -1,4 +1,5 @@
|
|||
using Discord;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Discord;
|
||||
using Discord.Rest;
|
||||
using Discord.WebSocket;
|
||||
|
||||
|
@ -8,16 +9,17 @@ public static class EventHandler {
|
|||
private static readonly DiscordSocketClient Client = Boyfriend.Client;
|
||||
private static bool _sendReadyMessages = true;
|
||||
|
||||
[SuppressMessage("ReSharper", "ConvertClosureToMethodGroup")]
|
||||
public static void InitEvents() {
|
||||
Client.Ready += ReadyEvent;
|
||||
Client.MessageDeleted += MessageDeletedEvent;
|
||||
Client.MessageReceived += MessageReceivedEvent;
|
||||
Client.MessageUpdated += MessageUpdatedEvent;
|
||||
Client.UserJoined += UserJoinedEvent;
|
||||
Client.GuildScheduledEventCreated += ScheduledEventCreatedEvent;
|
||||
Client.GuildScheduledEventCancelled += ScheduledEventCancelledEvent;
|
||||
Client.GuildScheduledEventStarted += ScheduledEventStartedEvent;
|
||||
Client.GuildScheduledEventCompleted += ScheduledEventCompletedEvent;
|
||||
Client.Ready += () => ReadyEvent();
|
||||
Client.MessageDeleted += (x, y) => MessageDeletedEvent(x, y);
|
||||
Client.MessageReceived += x => MessageReceivedEvent(x);
|
||||
Client.MessageUpdated += (x, y, z) => MessageUpdatedEvent(x, y, z);
|
||||
Client.UserJoined += x => UserJoinedEvent(x);
|
||||
Client.GuildScheduledEventCreated += x => ScheduledEventCreatedEvent(x);
|
||||
Client.GuildScheduledEventCancelled += x => ScheduledEventCancelledEvent(x);
|
||||
Client.GuildScheduledEventStarted += x => ScheduledEventStartedEvent(x);
|
||||
Client.GuildScheduledEventCompleted += x => ScheduledEventCompletedEvent(x);
|
||||
}
|
||||
|
||||
private static Task ReadyEvent() {
|
||||
|
|
Reference in a new issue