- Python 3.7
- Pipenv
pip install pipenv
- Git
The bot rely on the site to provide access to his database. It mean that if you want your local bot to have access to a database, which is required for most of his functionalities. Learn how to setup the site here
You will need access to a copy of the git repository of your own that will allow you to edit the code and push your commits to. Creating a copy of a repository under your own account is called a fork.
- Learn how to create a fork of the repository here. This is where all your changes and commits will be pushed to, and from where your PRs will originate from. For any staff member or contributor, since you have write permissions already to the original repository, you can just create a feature branch to push your commits to instead.
You will need your own test server and bot account on Discord to test your changes to the bot.
- Create a test server
- Create a bot account
- Invite it to the server you just created. Setup the listed Channels and Roles below in your test server.
#ot-offtopics
(at least one)#help-0
(at least one)#bot-commands
#reddit
#dev-log
#mods
#defcon
#mod-alerts
#talent-pool
#big-brother
#mod-log
#user-log
#message-change-log
@Admins
@Moderators
@Developers
(to act as verified role, same as in-server)@Muted
Most of the configuration settings default of the bot are inside the comfig-default.yml
file. However, this file is checked out by git, so you shouldn't edit this file, except for adding new entries. Instead of modifying this file, you can duplicate it and name it config.yml
, and the bot will use it to override default values. You need to change the following values in the config.yml
fle:
- Copy the test server id and copy it to the
id
entry in theguild
category. If you are not sure about how to copy the guild and channel IDs, check out the information over here. - Change the channel and role IDs in the
guild
too to match the ones in your test server. - Create a webhook in each of
#talent-pool
,#big-brother
and#reddit
and copy the IDs for them into the config file also. - Go down to the
urls
category and setsite
to"pythondiscord.local:8000"
. - In the same category set also
site_schema
to"http://"
.
We use some environment variables to safely store a couple of settings. Instead of creating actual environment variables, we are going to put them in a .env
file to keep everything securized. Variable are defined one per line using a key=value
syntax. First thing first, we need to create this file inside the root of your local clone, but Windows doesn't allow you to simply rename a file .env
, so we need to bypass this restriction using command line.
echo. > .env
Then, you can type in the file the following :
BOT_API_KEY=badbot13m0n8f570f942013fc818f234916ca531
BOT_TOKEN=<bot token here>
And replace <bot token here>
by your actual bot token.
If you also run the site, start it first, and then use pipenv to launch the bot.
pipenv run start
Now that you have everything setup, it is finally time to make changes to the bot! If you have not yet read the contributing guidelines, now is a good time. Contributions that do not adhere to the guidelines may be rejected. Notably, version control of our projects is done using Git and Github. It can be intimidating at first, so feel free to ask for any help in the server. Click here to see the basic Git workflow when contributing to one of our projects. Have fun!