Giter Club home page Giter Club logo

discord_bot_public's Introduction

My First Discord Bot

A project I've taken on to practise consuming/using unfamilar API. Also gained experience using Docker, and best practices regarding code layout for Docker.

Bot Functionality / Commands Supported

Some examples of the bot's functionality are showcased below.

!help

Once the bot is running, you can also use !help and !help command_name for more information on the commands available. For example:

plot

and for more detailed help per command:

plot

!kill

plot

!squirdle

plot

!rizz

plot

!speak

plot

Regular Message Responses

The bot recognises some basic phases within messages, such as greetings:

plot

and other useful things like:

plot

Setup + Running

This section contains instructions on getting the code running. It is recommended to use the Docker based setup, if possible.

Bot Token

To run a bot on Discord, you first need to create the bot on the Discord website. Once created, you need to retrieve the bot's secret token.

You then need to add this token to the code base. Specifically, create a file called secrets.txt in the bot_code/secrets/ directory. The file should then contain a single line in the format:

token your_bots_secret_token

This step is also needed when running the code with Docker.

Option 1: Docker (Recommended)

  1. Navigate to the root directory of the code base.

  2. Start up Docker on your machine.

  3. Build the Docker Image.

docker build -t kerapac-v1 .

  1. Run the Docker Container

docker run --name kerapac-v1-container -it kerapac-v1

  1. To stop the container, use Ctrl + C.

Option 2: Run Locally

First Time Setup

  1. Navigate to the root directory of the code base.

  2. Create a new python environment, making sure to use Python 3.6+.

python -m venv bot_py_env

  1. Activate the environment.

cd bot_py_env/Scripts/ && . activate && cd ../../ (windows)

  1. Confirm that you are now using the virtual environment.

pip list

This command should only show a couple of installed packages.

  1. Upgrade pip (optional)

pip install --upgrade pip

  1. Install the project's dependancies.

pip install -r requirements.txt

If there were any issues with the installation process, either consider using Docker, or tweak the versions of the packages as needed.

Running the code

  1. Navigate to the root directory of the code base.

  2. Activate the Python environment we created.

cd bot_py_env/Scripts/ && . activate && cd ../../ (windows)

  1. Navigate to the bot_code/ directory.

  2. Start the bot by running:

python main.py

Optionally including --cold-start if running the bot for the first time.

  1. Use Ctrl + C to shutdown the bot.

Data Scraping

The bot scrapes data that it needs when --cold-start is specified when running the bot. The data it collects can be added too by editing the file bot_code/scraper.py.

New data can be provided in the form specified at the start of that file.

discord_bot_public's People

Contributors

thorin88 avatar

Watchers

 avatar

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.