bind interaction to module

This commit is contained in:
rootdarkarchon
2022-10-20 14:29:11 +02:00
parent feb3cf328f
commit 54dd0b0f6e
4 changed files with 10 additions and 4 deletions

View File

@@ -54,6 +54,12 @@ internal class DiscordBot : IHostedService
await interactionModule.AddModuleAsync(typeof(MareModule), _services).ConfigureAwait(false);
await interactionModule.RegisterCommandsToGuildAsync(guild.Id, true).ConfigureAwait(false);
_discordClient.InteractionCreated += async (x) =>
{
var ctx = new SocketInteractionContext(_discordClient, x);
await interactionModule.ExecuteCommandAsync(ctx, _services);
};
_ = RemoveUsersNotInVanityRole();
}