A discord bot built in python, on the discord API
- Project description
- Todo
- Requirements
- Installation
- Testrun
- Issue tracker
- Code conventions
- Contribution
- Citing
- Contact
- Changelog
This project is going to be an automated Discord bot that can respond to members of a server.
A member will type a command in a channel and recieve a responce from the bot.
Functions will include a rock-paper-scissors game that keeps track of the score as well as a scoreboard.
Other functions will be to play 8ball or maybe even music. The prefix used to activate the bot will default to ?
but anyone with access to the code will be able to change it.
Note: Code will have to be adapted, for example every bot has a unique token.
Strings that requre additonal information are surrounded by two angle brackets << >>
,
information can be found in the Discord developer portal.
Here is a UML diagram of the class used in this project, you can find it in the user.py
file:
- Store user information
- Rock-paper-scissors
- 8ball
- Dice
- Message history
- Scoreboard
- Play music
- python 3.5+
- discord.py module
- requests module
The latest versoin of Python is available here.
To install the discord.py
package in the command prompt using the command pip install discord.py
.
For a guidde on the installation, click here.
Note that discord.py only works with Python 3.5+.
For the requests package, type pip install requests
into your command prompt.
To create your own bot, first you need to create an application in the developer portal.
Teminal:
Beep. Boop. . Bot is Ready
Discord channel:
>>> ?commands
dice + sides (optional) --> roll a die
8ball + question --> ask the magic 8ball a question
rps + choice --> play rock-paper-sissors against the bot
log --> log the last 50 messages in chat
hist + ammount --> show your fist messages
>>> ? rps rock
ROCK vs PAPER
You LOOSE!
>>> ?dice
6
>>> ?8ball Will it rain today?
Most likely
interact.py
--> Adding member: not automatedmain.py
--> Does not permanently store users- music requres module, not an API
- sometimes adding people doesn't work (above my pay grade)
Code is split up in to different files, by order of functions, for easier interaction and to facilitate contributions.
Commenting: 1-line comments are written above the code line to explain its purpose.
Naming: All files use snake_case for variable names as in standard PEP8.
This is a scool project and it will get a faling grade if someone other than me (the creator). After the grading, pull requests will gladly be accepted and new features would be appreciated.
- WIP
Paste this text into the top of your main file:
"All or part of this project uses code that was written by Bern4rdR
Repository: https://github.com/Bern4rdR/DiscordBot"
Author: Bernard R [Bern4rdR]
Mail: [email protected]
Discord: BernHard#6216
v0.1
Added:
- Manualy add a user through the bot
v0.2
Added:
- MINIGAME: Rock paper sissors
v0.3
Added:
- MINIGAME: dice
- MINIGAME: magic 8ball
Fixed:
- RPS not running if it creats new user
v0.4
Added:
- FEATURE: log the last 50 messages
- FEATURE: recieve your first messages
- FEATURE: help command
v0.5
Fixed:
- Can now add user trough command