kwoolter / DiscordBot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DiscordBot

Create a basic Discord bot using discord.py based on the realpython tutorial.

Features

  • on_ready - the bot starts up
  • on_message - handling message events
    • Different behaviour based on the channel that the message was received on
    • Different behaviour if the Bot was mentioned in the message
  • on_member_update - process a member of the server changing status e.g. going offline
  • Command events - process user-defined commands
    • Permissions using commands.has_role()
    • Cooldowns using commands.cooldown()
  • Embed - nicely formatted responses from the bot
  • Error Handling
    • on_error
    • on_command_error - an error processing a command

Dependencies

  • discord.py
  • python-dotenv

.env File

You will need to create you own .env file with the following environment variables defined:

DISCORD_TOKEN={ complete }
DISCORD_GUILD={ complete }
DISCORD_ROLE_GAMER=gamer
DISCORD_CHANNEL_GAME=game

References

About


Languages

Language:Python 100.0%