A discord bot written in python and uses discord.py, API wrapper for discord's websocket api, for management of guild Knights of the Dawned Sword. The bot feature multiple functions such as profile system, guild shop system, roles handling and much more.
The functionalities of the bot is simple but some step need to be followed to get it working on for your server.
- Clone the repository
git clone https://github.com/nipunrautela/KoDS-Bot.git
- Or just download the zip and unpack.
- Use venv or IDE based virtual environment setup.
- Run
pip install -r requirements
Note: Using a virtual environment is not necessary, but it is recommended for ease of port.
- Add
./cogs/assets/profile/image_cache/
if it doesn't exist. This directory temporarily store the profile images so that they can be easily sent to discord. There is code to handle automatic creation of the same. - Add
./cogs/data/parties.json
with content as{}
. Do not keep the file empty as the code expects JSON content to be present in the file. - Create a file
./settings.py
.
- Create an application on the discord developer portal.
- Set up a bot for the application.
- Turn on
Presence Intent
,Server Members Intent
, andMessage Content Intent
underPrivileged Gateway Intents
. - Generate the
OAuth2 URL
under the option with same name in developer portal. Use the link to add the bot to the server.
- Put the settings file in the root of the project
BOT_NAME = 'KODS Bot'
TOKEN = ""
GUILD_ID = 0
RANK_REQUEST_CHANNEL = 0
RANK_REQUEST_REDIRECT = 0
DB_HOST = ""
DB_USER = ""
DB_PASS = ""
DB_PORT = 0
DB_NAME = ""
ORDER_CHANEL = 0
BOT_DIR = '.'
BLACKLIST_CHANNELS = [
0,
]
BOT_NAME
field can be changed if you want the bot to be called something different.TOKEN
needs to contain the bot token you receive from the discord developer portal.GUILD_ID
should be set to the server ID of your guild server.RANK_REQUEST_CHANNEL
contains the channel ID where the rank promotion can be requested.RANK_REQUEST_REDIRECT
contains the channel ID where the above request will be sent for guild leader to review.DB_HOST
,DB_USER
,DB_PASS
,DB_PORT
,DB_NAME
are the credentials and details for your database setup. You can use environment variable or however you see fit.ORDER_CHANNEL
is the channel ID where the orders will be sent.BOT_DIR
can contain the full path of your Bot's directory. This can be useful when hosting you bot on a VPS.BLACKLIST_CHANNELS
is a list of channel IDs where the bots command can not be used.