A Discord bot for Quake III DeFRaG.
Python>=3.8.5 required
Conda environment not necessary, but suggested: https://docs.conda.io/projects/conda/en/latest/user-guide/getting-started.html
To install requirements, simply do:
pip install -r requirements.txt
-
Download PostgreSQL: https://www.postgresqltutorial.com/install-postgresql/
- port 5432
- username postgres
- password of your choice
-
Download pgAdmin4: https://www.pgadmin.org/download/
-
Open up pgAdmin4
-
Right click on Servers, create Server.
-
Name your server whatever you'd like.
-
Click on the connection tab, enter:
- Host: localhost
- Port: 5432
- Username: postgres
- Password: password chosen at step 1
- Save
-
Inside your server, right click Databases, create Database.
- Name this database "Defrag"
- Save
-
Right click the Defrag database, Restore...
-
Navigate to this repo's folder, select df.db (Note: you may have to select 'Format: all files' for this file to be visible)
- Click Restore
-
Once finished, confirm success by checking that there is an table named 'discord_ids' under Defrag -> Schemas -> Tables
-
If success, store your database password in keyring by running
python
in the project's environment and doing:>>> import keyring >>> keyring.set_password("db_password", "postgres", "<your password from step 1>")
-
Create an account/log in to:
-
Create a new app.
-
Navigate to the Bots tab.
-
Add a new bot, customize as desired.
-
Copy token.
-
Run
python
in the project's environment and do:>>> import keyring >>> keyring.set_password("bot_token", "dfbot", "<your token goes here>")
-
Navigate back to General Information in discord developers portal.
-
Copy the Client ID.
-
Invite bot to your server using the Client ID in this link:
https://discord.com/oauth2/authorize?client_id={Client_ID}&scope=bot
Note: To invite the bot to a server that is not yours,, give this link with your client ID to the server owner instead.
-
Finally, run the bot with
python dfbot.py
in the proper environmentYou should see a message such as
We have logged in as DFBot#xxxx
And the bot's status should be 'online'.