A modularized discord bot based on discord.py
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
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.
You need to have a discord bot account and get your bot token ready.
- Use
git clone
to directly fetch this repository. - Download the compressed zip package and unzip it.
Before you start the bot, you need to edit .env.example
and config.json.example
provided under config
folder.
-
.env.exmaple
fileVariable 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
fileVariable 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 upuse_translator Set to true
to enable command localization supportdev_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
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.
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
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
TODO
Distributed under the MIT License. See LICENSE.txt
for more information.
Feiyu Zheng - [email protected]
Project Link: https://github.com/ChaserZ98/Fisher