Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #74

Merged
merged 2 commits into from
Oct 19, 2024
Merged

Dev #74

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading