Skip to content

ChaserZ98/Fisher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues MIT License


Logo

Fisher

A modularized discord bot based on discord.py
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. License
  5. Contact
  6. Acknowledgments

About The Project

This repository provides an implementation of a discord bot with ability to load, unload and reload modules on demand. This allows you to add or remove cogs without rebooting the discord bot and also allows you to hot fix some cogs with a simple reload.

(back to top)

Built With

  • Python
  • Discord.py

(back to top)

Getting Started

Prerequisites

You need to have a discord bot account and get your bot token ready.

Download

  • Use git clone to directly fetch this repository.
  • Download the compressed zip package and unzip it.

Configuration

Before you start the bot, you need to edit .env.example and config.json.example provided under config folder.

  • .env.exmaple file

    Variable What it is
    BOT_TOKEN The token of your bot
    LEETCODE_SESSION Your leetcode session token (please see the usage section for details)
  • config.json.example file

    Variable What it is
    prefix The prefix you want to use for normal commands
    description The content prefixed into the default help message.
    application_id The application ID of your bot
    permissions The permissions integer your bot needs when it gets invited
    sync_commands_globally Set to true to enable command sync globally during start up
    use_translator Set to true to enable command localization support
    dev_channel_id The ID of your default notification channel
    bot_status A list of status you want your bot to switch with along time
    extensions A list of extension you want your bot to load during start up
    owners A list of user IDs with the owner priviledge

After editing these two files, do the following steps:

  • Move .env.example file to the project's root directory (/path/to/Fisher)
  • Remove the .example postfix of two files

Launch

To launch the bot, you can directly execute python3 src/bot.py. Further, if you are familiar with Docker/Docker Compose, you can utilize the provided Dockerfile and follow the instruction below to dockerize your bot.

Docker

If you are familiar with Docker, you can directly build the docker image using the provided Dockerfile using the below command.

docker build -t fisher:alpine .

Then use the following command to create and start the container.

docker run -it --rm \
    --name fisher \
    -v /path/to/Fisher:/usr/share/Fisher \
    -w /usr/share/Fisher \
    fisher:alpine python src/bot.py

Docker Compose

If you are familiar with Docker Compose, you can use the following code snippet as an example to be added to your docker-compose.yml file.

fisher:
    build: /path/to/Fisher
    image: fisher:alpine
    container_name: fisher
    restart: unless-stopped
    volumes:
      - /path/to/Fisher:/usr/share/Fisher
    working_dir: /usr/share/Fisher
    command: python src/bot.py

Then you can use the following command to start the project.

docker compose up -d fisher

(back to top)

Usage

TODO

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Feiyu Zheng - [email protected]

Project Link: https://github.com/ChaserZ98/Fisher

(back to top)

Acknowledgments

(back to top)

About

A modular and extensible discord bot based on discord.py

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published