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,11 +170,15 @@ internal class WorldTime : IDisposable {
}
#else
// Debug: Register our commands locally instead, in each guild we're in
if (arg.Guilds.Count > 5) {
Program.Log("Command registration", "Are you debugging in production?! Skipping DEBUG command registration.");
} else {
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
}