Skip to content

Lord-Ptolemy/discord-bot-best-practices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 

Repository files navigation

Best practices for Discord bots

NB: These guidelines are intended for bots running on public servers. If your bot is restricted to private ones, this document likely doesn't apply to you.

  1. Commands should be explicitly invoked. Bots should not activate on normal chat. Instead, use a command prefix or only respond when your bot is directly @mentioned.
  2. Use unique prefixes. Single-character prefixes such as !, $ and . are commonplace for activating commands and lead to overlaps with other bots. Should you opt to use a prefix for your bot, consider using words (owl) or unique Unicode characters (¨).
  3. Don't be greedy. Restrict yourself to a small number of prefixes to reduce the risk of collision with others.
  4. Don't scrape for invites. Invite scraping, where a bot searches for invites and blindly joins other servers, is officially discouraged by Discord. Should a bot be reported, it may be banned or otherwise restricted.
  5. Don't overuse mentions. If you reply directly to a command, don't use a mention, they can lead to bot reply loops. Mentions are fine if a long running command is executed, but private messages are a good alternative.
  6. Don't reply with "invalid command". If a user uses a command that does not exist, then let it fail silently. Do not have it reply with something like "invalid command". Though if the command is correct, but arguments are wrong then it's okay to reply with "invalid args". The reason for this is if the bot is in more than 1 server and there's another bot and they have conflicting prefixes it becomes a problem as it's annoying.

If you have an idea for an addition or change to this document, please make a pull request and we can discuss it.

About

Best practices for making Discord bots.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published