diff --git a/docs/guides/commands/samples/intro/command_handler.cs b/docs/guides/commands/samples/intro/command_handler.cs index e4531fa41..efb31f9b9 100644 --- a/docs/guides/commands/samples/intro/command_handler.cs +++ b/docs/guides/commands/samples/intro/command_handler.cs @@ -35,9 +35,10 @@ public class CommandHandler // Create a number to track where the prefix ends and the command begins int argPos = 0; - // Determine if the message is a command based on the prefix + // Determine if the message is a command based on the prefix and make sure no bots trigger commands if (!(message.HasCharPrefix('!', ref argPos) || - message.HasMentionPrefix(_client.CurrentUser, ref argPos))) + message.HasMentionPrefix(_client.CurrentUser, ref argPos)) || + message.Author.IsBot) return; // Create a WebSocket-based command context based on the message @@ -60,4 +61,4 @@ public class CommandHandler // if (!result.IsSuccess) // await context.Channel.SendMessageAsync(result.ErrorReason); } -} \ No newline at end of file +}