I'm new to C # and I'm programming my first big project, the Discord bot. The idea is that the bot looks through comments, waiting for Cthulhu's words, and as soon as someone speaks to Cthulhu, the bot sends a message. However, in its current state, it never stops sending messages. I suspect that something is wrong with my conditional, but I have no idea how to fix it. How do I change my code to fix this?
This is my code, I have the NuGet discord.net and discord.commands packages installed:
discord.MessageReceived += async (s, e) =>
{
if (e.Message.RawText.Contains("Cthulhu") )
await e.Channel.SendMessage("*Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn*");
};
source
share