#New Bot command not working

1 messages · Page 1 of 1 (latest)

ruby geyser
#

I created a bot, but it doesn't reply to commands. No errors or anything either.

gaunt goblet
#

Try passing a logger

#

Additionally, can you verify that ClientToken.Get returns the token?

ruby geyser
#

I did a WriteLIne of the token, that works

gaunt goblet
#

Also, as of .NET 5, you can have an async main method, like such: ```cs
public static async Task Main(string[] args)

ruby geyser
#

ahh thank you I wondered about that

gaunt goblet
#

Anywho, if you still can't figure it out, maybe making StartingCommands public instead of internal might fix it?

#

Everything certainly looks correct

ruby geyser
#

with the logger it looks like this

#

and sending the command in an accessible channel doesn't affect the debugger

#

I can also confirm changing the protection level of StartingCommands did not fix it :(

#

I'm not sure if this is relevant but it was working before I added it to my antivirus exceptions

#

It seems to be irrelavent because removing it from exceptions changed nothing

#

Upon further testing, It seems to be an issue with my implementation of CommandsNext 🤔

#

Adding ```cs
discord.MessageCreated += async (s, e) => // REMOVE
{ // ALL
if (e.Message.Content.ToLower().StartsWith("ping")) // OF
await e.Message.RespondAsync("pong!"); // THESE
};

#

I have narrowed it down further

#

It only breaks when I add the overload for string name

#

oh because I wasn't passing in a string when I called it 💀