Sanity checking to command registration

This commit is contained in:
Noi 2022-08-09 18:18:38 -07:00
parent b595e701c4
commit eb7e3948cd

View file

@ -170,10 +170,14 @@ internal class WorldTime : IDisposable {
} }
#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
var iasrv = _services.GetRequiredService<InteractionService>(); if (arg.Guilds.Count > 5) {
foreach (var g in arg.Guilds) { Program.Log("Command registration", "Are you debugging in production?! Skipping DEBUG command registration.");
await iasrv.RegisterCommandsToGuildAsync(g.Id, true).ConfigureAwait(false); } else {
Program.Log("Command registration", $"Updated DEBUG command registration in guild {g.Id}."); var iasrv = _services.GetRequiredService<InteractionService>();
foreach (var g in arg.Guilds) {
await iasrv.RegisterCommandsToGuildAsync(g.Id, true).ConfigureAwait(false);
Program.Log("Command registration", $"Updated DEBUG command registration in guild {g.Id}.");
}
} }
#endif #endif
} }