C
C#3mo 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 User3mo ago
Message Not Public
Sign In & Join Server To View
Wagi
Wagi3mo 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.