Noticed I'm getting warnings on my event handlers.
[2022-10-23 13:19:58 +00:00] [104 /EventHandler] [Warn ] An event handler for READY took too long to execute.
[2022-10-23 13:51:41 +00:00] [104 /EventHandler] [Warn ] An event handler for GUILD_MEMBER_ADD took too long to execute.
[2022-10-23 14:26:02 +00:00] [104 /EventHandler] [Warn ] An event handler for GUILD_MEMBER_ADD took too long to execute.
Figured I'd try to dispatch the work to another thread to solve the problem, is this the recommended approach for discord? Thanks
discord.GuildMemberAdded += async (s, e) => //event fired when a member joins
{
await Task.Run(async () => {
//do the work here
});
};