Omnipotent guild management bot for FIRST Discord servers
run python -V
to find what version of python you are running. If you are running version 3.8 or newer, feel free to skip this section
run python -V
to ensure that version 3.8 or newer is installed.
Many distributions do not have python 3.8 in their repositories yet. If this is the case for you, then pyenv is a great option for managing different python versions.
Instructions for installing are located here.
pyenv install 3.8.2
downloads and builds a newer version of pythonpyenv global 3.8.2
sets 3.8.2 as the primary version for the current user- run
python -V
to ensure that version 3.8 or newer is installed.
If you are on macOS, there may be more steps to complete involving SSL certificates to connect to Discord correctly. Please see this thread for more info.
Through the rest of this README, we will assume that you have found the correct python
executable for your setup and are using it accordingly.
As of May 13, 2020 , Dozer no longer supports database types other than PostgreSQL. This means installations using SQLite (as was default), will need to migrated, as well as new installations will have to have PostgreSQL installed on the machine for development or production. You can install PostgreSQL for your platform here
-
Go to the Discord Developer Portal and create a new application.
-
Create a bot user inside of your application.
-
Copy the bot user token - We'll need that later! Do not share your token with anyone. If someone obtains your bot user token, they gain full control of your bot. Be careful!
-
Go to the Google Map APIs Docs and request an API key
-
Create a new project.
-
Copy the API key - We'll need this too!
Currently, getting an API token requires a credit card. If you do not wish to make such a heavy commitment to your bot right now, entering nothing or keeping the default value for your API token will not cause the bot any troubles unless you attempt to call a command that utilizes it.
-
Install dependencies with
python -m pip install -Ur requirements.txt
-
Run the bot once with
python -m dozer
. This will crash, but generate a default config file.- Dozer uses json for its config file
-
Add the Discord bot account's token to
discord_token
inconfig.json
-
Add your Google Maps API key to
gmaps_key
inconfig.json
-
If you do not have an API key, don't touch this setting, but your bot will not have access to commands that use the GMAPI.
-
Add information about your team and your bot to
tba
inconfig.json
-
Add your database connection info to
db_url
inconfig.json
using the following format:postgres://user:password@host:port
Replace
host
with your database IP, orlocalhost
if it's on the same PC.port
is by default 5432. If the user has no password, you can remove the colon and password. The default user for the above installation ispostgres
, however we strongly suggest making adozer
user for security reasons using this guide. -
Add your ID, and anyone else's ID who should be able to use the developer commands, to the list
developers
inconfig.json
- Be careful giving this out. Developers can control everything your bot does and potentially get your bot user token!
-
The default command prefix is %. If this is already in use on your server or you would like another prefix, you can change the
prefix
value inconfig.json
. -
Run the bot again, you should see
Signed in as username#discrim (id)
after a few seconds.
Note: This process will eventually be replaced by an invite
command.
-
To add the bot to your server, paste the following link into your browser. Your client ID can be found on the applications page in the Discord Developer Portal
https://discordapp.com/oauth2/authorize?client_id=YOUR_CLIENT_ID&scope=bot
-
Select the server that you would like to add the bot to.
-
Try it out!
[prefix]help
to see what Dozer can do.
If you want just a database file with no replication, Dozer will work using SQLite without needing any extra work on your end.
If you're interested in using a more advanced database system, we recommend postgres. You can set up postgres on your own server
or use a service such as ElephantSQL. To make it work in Dozer, install the psycopg2 pip package, then change the db_url
key
in config.json
to a URL that follows this format: postgresql://username:password@host/db_name_in_postgres
with the correct
information filled in.