Discord-Net-Labs / Discord.Net-Labs

An experimental fork of Discord.Net that implements the newest discord features for testing and development to eventually get merged into Discord.Net
https://labs.discordnet.dev
MIT License
156 stars 42 forks source link

Message/User commands are not being executed when their name have spaces on it #307

Closed d4n3436 closed 2 years ago

d4n3436 commented 2 years ago

When using the interaction service with context commands, they are registered and appear on the client, but using them will do nothing. This only happens when their name have spaces (" ").

I mentioned this bug to @Cenngo a few days ago, but I guess this wasn't fixed.

Example commands:

[UserCommand("Get Avatar")]
public async Task GetAvatar(IUser user)
{
    string url = "";
    if (user is RestGuildUser guildUser)
        url = guildUser.GetGuildAvatarUrl();

    url ??= user.GetAvatarUrl() ?? user.GetDefaultAvatarUrl();

    await RespondAsync(url);
}

[MessageCommand("Get Text")]
public async Task GetText(IMessage message)
{
    await RespondAsync(message.Content);
}