This is the official repository for The Cyber Empire's Discord bot. It is built with TypeScript using the Sapphire framework on top of the discord.js library. We use the Sequelize ORM as database interface and MariaDB as primary database system.
git clone https://github.com/CyberEmpire/discord-bot.git
cd discord-bot && npm i
Copying the template file.
cp .env_example .env
See details below on how to fill in variables.
npm test
In this section we'll discuss how to fill properly the .env
file, detailing the use of each variables.
Note: This section assumes you already have a connection-ready database system and Discord Bot.
First open the file with the editor of your choice, the file should look like this:
DB_HOST="127.0.0.1"
DB_DATABASE="database_name"
DB_USER="user"
DB_PASS="secret"
BOT_TOKEN="Discord bot Token"
BOT_PREFIX="!"
GUILD_ID="Server ID"
Now you need to replace the placeholders with actual credentials/values. The DB_* variables are related to the database connection. You need to fill-in proper connection details (Make sure that the user has all privileges on the database). Next are the BOT_* variables, these variables are relative to the Discord Bot client. Only the BOT_TOKEN variable is required, the others are optionnal. Finally the GUILD_* variables corresponds to the Discord server you will bind the bot to. This is because the bot is not aimed to be a public bot but to be used on a single server.
To help you in coding efficiently we recommend using Visual Studio Code with the following extensions:
- ESLint: For TypeScript/JavaScript linting.
- Prettier: This is the code formatter this repository uses. (Alternatively you can use the '
npm run format
' command) - JavaScript and TypeScript Nightly: For better TS IntelliSense
- THE REST OF THIS FILE
- Reproduce 1:1 the original bot