Skip to content

Commit

Permalink
Merge pull request #74 from GravityWolfNotAmused/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
GravityWolfNotAmused authored Oct 19, 2024
2 parents 7f4a008 + 5a5f26f commit 2df8116
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
17 changes: 16 additions & 1 deletion DiscordPlayerCountBot/Bot/Bot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,22 @@ private async Task DiscordClient_Ready()
Description = $"This will show the player count for the server: {Information.Name}"
};

await DiscordClient.CreateGlobalApplicationCommandAsync(globalCommand.Build());
try
{
await DiscordClient.Rest.DeleteAllGlobalCommandsAsync();
}catch(Exception ex)
{
Error("Failed to delete global commands.", Information.Id.ToString(), ex);
}

try
{
await DiscordClient.CreateGlobalApplicationCommandAsync(globalCommand.Build());
}
catch (Exception ex)
{
Error("Failed to apply global commands.", Information.Id.ToString(), ex);
}
}

public async Task StartAsync(bool shouldStart)
Expand Down
4 changes: 1 addition & 3 deletions DiscordPlayerCountBot/Providers/RconProvider.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using PlayerCountBot.Enums;
using PlayerCountBot.Exceptions;
using PlayerCountBot.Services;
using PlayerCountBot.Exceptions;

namespace PlayerCountBot.Providers
{
Expand Down

0 comments on commit 2df8116

Please sign in to comment.