Add Discord Welcome Bot to your Discord server
- git
- node.js >= 16.x
- npm
After clone the repo to your local machine, perform the following command to install the required dependencies:
$ npm install
After installing the required dependencies, run the following command to start the bot:
$ npm start
Or you can run the following command to start the bot with nodemon, so the bot will be automatically restarted once changes are detected:
$ npm test
Obtain the Discord application token from the Discord developer portal.
Once the token is obtained, create a .env
file to store the configurations. Remember to not leak those. Prefix is a special function call so the bot will not response to every single messages. You can choose any prefix as you wish.
This program uses postgresql as the database. URL format should be postgres://{user}:{password}@{host}:{port}/{database}
.
# .env
DISCORD_TOKEN=YOUR_TOKEN
DATABASE_URL=POSTGRES_DATABASE_URL
PREFIX=!
module.exports = {
name: "",
description: "",
usage: "",
category: "",
aliases: [],
agrs: true,
execute() {
// code to execute
},
};