mirror of
https://github.com/NoiTheCat/BirthdayBot.git
synced 2024-11-22 05:54:36 +00:00
Sanity checking to command registration
This commit is contained in:
parent
31d5513c9e
commit
92be9ca073
1 changed files with 9 additions and 4 deletions
|
@ -116,15 +116,20 @@ public sealed class ShardInstance : IDisposable {
|
||||||
#if !DEBUG
|
#if !DEBUG
|
||||||
// Update slash/interaction commands
|
// Update slash/interaction commands
|
||||||
if (ShardId == 0) {
|
if (ShardId == 0) {
|
||||||
await _interactionService.RegisterCommandsGloballyAsync(true).ConfigureAwait(false);
|
await _interactionService.RegisterCommandsGloballyAsync(true);
|
||||||
Log(nameof(ShardInstance), "Updated global command registration.");
|
Log(nameof(ShardInstance), "Updated global command registration.");
|
||||||
}
|
}
|
||||||
#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
|
||||||
|
if (DiscordClient.Guilds.Count > 5) {
|
||||||
|
Program.Log(nameof(ShardInstance), "Are you debugging in production?! Skipping DEBUG command registration.");
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
foreach (var g in DiscordClient.Guilds) {
|
foreach (var g in DiscordClient.Guilds) {
|
||||||
await _interactionService.RegisterCommandsToGuildAsync(g.Id, true).ConfigureAwait(false);
|
await _interactionService.RegisterCommandsToGuildAsync(g.Id, true).ConfigureAwait(false);
|
||||||
Log(nameof(ShardInstance), $"Updated DEBUG command registration in guild {g.Id}.");
|
Log(nameof(ShardInstance), $"Updated DEBUG command registration in guild {g.Id}.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue