Discord bot is not responding to commands only in pm

Viewed 40

Im following the bot guide from c#Fritz but my bot is not behaving well.

In my test server it has got Administrator rights (from discord/developer - URL-bot-administrator) When I type 'foo' it doesnt reply?

If I open a PM with the bot it DOES??

Code .NET 6:

using DSharpPlus;

var client = new DiscordClient(new DiscordConfiguration
{
    Token = "INSERT TOKEN HERE",
    TokenType = TokenType.Bot
});

client.MessageCreated += async (client, args) =>
{
    if (args.Message.Content.StartsWith("foo"))
    {
        await client.SendMessageAsync(args.Channel, "bar");
    }
};

await client.ConnectAsync();
await Task.Delay(-1);

please let me know if you need more info?

0 Answers
Related