mirror of
https://github.com/NoiTheCat/WorldTime.git
synced 2024-10-16 08:29:57 +00:00
Sanity checking to command registration
This commit is contained in:
parent
b595e701c4
commit
eb7e3948cd
1 changed files with 8 additions and 4 deletions
12
WorldTime.cs
12
WorldTime.cs
|
@ -170,10 +170,14 @@ internal class WorldTime : IDisposable {
|
|||
}
|
||||
#else
|
||||
// Debug: Register our commands locally instead, in each guild we're in
|
||||
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}.");
|
||||
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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue