Skip to content

Commit

Permalink
Merge pull request #15 from cruikshj:cruikshj/issue14
Browse files Browse the repository at this point in the history
Global commands remain after switching to guild
  • Loading branch information
cruikshj authored May 25, 2024
2 parents c7e006a + 6792d38 commit 6c2a1f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ServerManagerDiscordBot/CommandManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@ public async Task RegisterCommandsAsync()
await InteractionService.AddModulesAsync(Assembly.GetEntryAssembly(), ServiceProvider);

if (!AppSettings.GuildIds.Any())
{
{
Commands = await InteractionService.RegisterCommandsGloballyAsync(true);
}
else
{
await InteractionService.RestClient.DeleteAllGlobalCommandsAsync();
foreach (var guildId in AppSettings.GuildIds)
{
Commands = await InteractionService.RegisterCommandsToGuildAsync(guildId, true);
Expand Down

0 comments on commit 6c2a1f5

Please sign in to comment.