No updates detected yet. GitHub releases will appear here.
Discord bot for me.
翻訳待ち
Loading the full README.
Read the full README ↗My personal Discord bot.
Clone the Repository
git clone [Your Repository URL]
cd alia-bot
Install Dependencies
npm install
Environment Setup
.env file in the root directory with the following content:
BOT_TOKEN=your_discord_bot_token
NODE_ENV=development
MYSQLDB_DATABASE=aliadb
MYSQLDB_USER=aliabot
MYSQLDB_PASSWORD=your_mysql_password
MYSQLDB_ROOT_PASSWORD=your_mysql_root_password
MYSQLDB_LOCAL_PORT=3307
MYSQLDB_DOCKER_PORT=3306
NODE_LOCAL_PORT=6868
NODE_DOCKER_PORT=8080
your_discord_bot_token, your_mysql_password, and your_mysql_root_password with your actual credentials..env file to source control to maintain security.Start the MySQL Database
docker-compose up -d mysqldb
Run the Application
npm run start
npm run lint to start ESLint.npm run test to start the Jest test runner.Developing and testing a Discord bot can be exciting and challenging. However, it's crucial to do so in a safe and controlled environment. Using a test guild allows you to rigorously test and debug your bot without the risk of impacting your main guild or exposing your production bot token. This setup is especially important to keep your production token off your local machine, ensuring higher security and peace of mind.
Another key reason for this setup is to avoid the confusion and frustration of having two bots (development and production) responding to the same commands. If both your development and production bots are active in the same guild, they might both respond to commands, making it difficult to distinguish which bot's changes are being tested. Additionally, you don't want to turn off your production bot while developing, as it may be serving a live community.
By using a test guild, you can freely experiment, make changes, and encounter errors without any real-world consequences for your bot's users and without the confusion of overlapping bot responses.
DiscordJS Guide has a great guide on this if you need a second reference Setting up a bot application
Create a New Discord Guild:
Create a New Discord Application:
Enable Guild Messages Intent:
Get the Bot Token:
Invite the Bot to Your Test Guild:
Configure the Development Environment:
.env file or other environment variable configurations.Run the Bot in the Test Guild:
When setting up alia-bot for the first time, or after making significant changes to the database structure, it's important to ensure that your database is properly configured. This can involve initializing tables, loading initial data, or applying migrations. To simplify this process, an onboarding script can be used.
The onboarding script should automate the following tasks:
You can create a script (e.g., onboarding.js) in your project's root directory with the necessary logic and then include instructions in the README on how to run it.
####### TODO: WRITE THE ONBOARDING SCRIPT
This is the beginning of the README. Read the rest at the original. Read the full README ↗