Skip to content
forked from FRCDiscord/Dozer

Omnipotent guild management bot for FIRST Discord servers

License

Notifications You must be signed in to change notification settings

guineawheek/Dozer

 
 

Repository files navigation

Dozer

travis

Omnipotent guild management bot for FIRST Discord servers

Table of Contents

Setup

Installing Python 3.8

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

Manually

Unix

Windows

run python -V to ensure that version 3.8 or newer is installed.

Using pyenv

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.

  1. pyenv install 3.8.2 downloads and builds a newer version of python
  2. pyenv global 3.8.2 sets 3.8.2 as the primary version for the current user
  3. 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.

Installing PostgreSQL

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

Getting your Discord Bot Token

  1. Go to the Discord Developer Portal and create a new application.

    creating a new discord app

  2. Create a bot user inside of your application.

    creating a bot user

  3. 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!

Getting a Google Maps API Key

  1. Go to the Google Map APIs Docs and request an API key

  2. Create a new project.

    creating a new project

  3. 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.

Setting up the bot

  1. Install dependencies with python -m pip install -Ur requirements.txt

  2. Run the bot once with python -m dozer. This will crash, but generate a default config file.

    1. Dozer uses json for its config file
  3. Add the Discord bot account's token to discord_token in config.json

  4. Add your Google Maps API key to gmaps_key in config.json

  5. 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.

  6. Add information about your team and your bot to tba in config.json

  7. Add your database connection info to db_url in config.json using the following format:

    postgres://user:password@host:port

    Replace host with your database IP, or localhost 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 is postgres, however we strongly suggest making a dozer user for security reasons using this guide.

  8. Add your ID, and anyone else's ID who should be able to use the developer commands, to the list developers in config.json

    1. Be careful giving this out. Developers can control everything your bot does and potentially get your bot user token!
  9. 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 in config.json.

  10. Run the bot again, you should see Signed in as username#discrim (id) after a few seconds.

Adding the bot to your server

Note: This process will eventually be replaced by an invite command.

  1. 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

  2. Select the server that you would like to add the bot to.

  3. Try it out! [prefix]help to see what Dozer can do.

Setting up the database systems

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.

About

Omnipotent guild management bot for FIRST Discord servers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Python 100.0%