GithubHelp home page GithubHelp logo

slayerman's Introduction

DFBot

A Discord bot for Quake III DeFRaG.

Environment

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

Setting up local Database

  1. Download PostgreSQL: https://www.postgresqltutorial.com/install-postgresql/

    • port 5432
    • username postgres
    • password of your choice
  2. Download pgAdmin4: https://www.pgadmin.org/download/

  3. Open up pgAdmin4

  4. Right click on Servers, create Server.

  5. Name your server whatever you'd like.

  6. Click on the connection tab, enter:

    • Host: localhost
    • Port: 5432
    • Username: postgres
    • Password: password chosen at step 1
    • Save
  7. Inside your server, right click Databases, create Database.

    • Name this database "Defrag"
    • Save
  8. Right click the Defrag database, Restore...

  9. 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
  10. Once finished, confirm success by checking that there is an table named 'discord_ids' under Defrag -> Schemas -> Tables

  11. 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>")
    

Running the bot

  1. Create an account/log in to:

    https://discord.com/developers/applications

  2. Create a new app.

  3. Navigate to the Bots tab.

  4. Add a new bot, customize as desired.

  5. Copy token.

  6. Run python in the project's environment and do:

    >>> import keyring
    >>> keyring.set_password("bot_token", "dfbot", "<your token goes here>")
    
  7. Navigate back to General Information in discord developers portal.

  8. Copy the Client ID.

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

  10. Finally, run the bot with

    python dfbot.py in the proper environment

    You should see a message such as

    We have logged in as DFBot#xxxx

    And the bot's status should be 'online'.

slayerman's People

Contributors

jbustos22 avatar donaldduck8 avatar harukama avatar

Stargazers

Дмитрий avatar  avatar

Watchers

 avatar  avatar

slayerman's Issues

Make bot asynchronous

Commands block the bot, this will be a problem for !update and !random for example

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.