mirror of
https://github.com/NoiTheCat/BirthdayBot.git
synced 2024-11-25 01:44:12 +00:00
Fix registration not working in release
This commit is contained in:
parent
5c6e0777f5
commit
2c9920d87f
1 changed files with 3 additions and 3 deletions
|
@ -118,7 +118,7 @@ class ShardInstance : IDisposable {
|
||||||
}
|
}
|
||||||
#if !DEBUG
|
#if !DEBUG
|
||||||
// Remove any unneeded/unused commands
|
// Remove any unneeded/unused commands
|
||||||
var existingcmdnames = cmds.Select(c => c.Name.Value).ToHashSet();
|
var existingcmdnames = commands.Select(c => c.Name.Value).ToHashSet();
|
||||||
foreach (var gcmd in await DiscordClient.GetGlobalApplicationCommandsAsync()) {
|
foreach (var gcmd in await DiscordClient.GetGlobalApplicationCommandsAsync()) {
|
||||||
if (!existingcmdnames.Contains(gcmd.Name)) {
|
if (!existingcmdnames.Contains(gcmd.Name)) {
|
||||||
Log("Command registration", $"Found registered unused command /{gcmd.Name} - sending removal request");
|
Log("Command registration", $"Found registered unused command /{gcmd.Name} - sending removal request");
|
||||||
|
@ -126,8 +126,8 @@ class ShardInstance : IDisposable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// And update what we have
|
// And update what we have
|
||||||
Log("Command registration", $"Bulk updating {cmds.Length} global command(s)");
|
Log("Command registration", $"Bulk updating {commands.Count} global command(s)");
|
||||||
await DiscordClient.BulkOverwriteGlobalApplicationCommandsAsync(cmds).ConfigureAwait(false);
|
await DiscordClient.BulkOverwriteGlobalApplicationCommandsAsync(commands.ToArray()).ConfigureAwait(false);
|
||||||
#else
|
#else
|
||||||
// Debug: Register our commands locally instead, in each guild we're in
|
// Debug: Register our commands locally instead, in each guild we're in
|
||||||
foreach (var g in DiscordClient.Guilds) {
|
foreach (var g in DiscordClient.Guilds) {
|
||||||
|
|
Loading…
Reference in a new issue