Bots can and should:
- Interact on the server
- Track member stats
- Do cool things
- Music
- Pictures
Table of Contents
Follow the guide here
- Starting a server
- Creating a bot on the Discord Dev Portal
- Adding the bot to your server
- Permissions
- Getting started with Discord Bots in python
Use one of the following or just download the .zip
here.
> gh repo clone XDwightsBeetsX/discord-bots
> git clone https://github.com/XDwightsBeetsX/discord-bots.git
Check the requirements.txt
-
Most will need to simply install the discord python API:
> pip install discord
-
You can also make sure you got it all (it's not much):
> pip install requirements.txt
- Store tokens/keys in a folder like
keys
- Add your folder to the
.gitignore
to keep your key(s) safe - Add files like
keys/dwight.txt
- Parse these in with the bot using
utils/Parsing
- Add your folder to the
Easily run bots like any other python script!
> python <bot-name>.py
The first bot!
Discord Command | Info |
---|---|
!help |
Prints off a list of available commands. |
!dwight |
Messages: "Bears, Beets, Battlestar Galactica" |
!message_count |
Dwights lets you know how many messages have been sent. |
!member_count |
Dwight tells you how popular your server is |
A template for making new bots.
Offers some skeleton methods:
__main__
run()
sendMessage(message)
writeStatsToFile()
logLine(line)
- General
- Bots
with reference to: realpython's tutorial
links: Discord Developer Portal