C
C#10mo ago
Wagi

✅ GetGlobalApplicationCommandsAsync exception

The code in question
c#
IReadOnlyCollection<SocketApplicationCommand> commands = await this.m_Discord.GetClient().GetGlobalApplicationCommandsAsync();
foreach (SocketApplicationCommand command in commands)
{
await command.DeleteAsync();
}
c#
IReadOnlyCollection<SocketApplicationCommand> commands = await this.m_Discord.GetClient().GetGlobalApplicationCommandsAsync();
foreach (SocketApplicationCommand command in commands)
{
await command.DeleteAsync();
}
See picture for the error. What am I doing wrong ?
No description
2 Replies
Unknown User
Unknown User10mo ago
Message Not Public
Sign In & Join Server To View
Wagi
WagiOP10mo ago
Nevermind, the bot was still connecting when this was attempted. I thought await would before DiscordSocketClient.StartAsync() did wait until the bot was connected.

Did you find this page helpful?