Discord bot for BTH Webbprogrammering
Create a .env
file in the root of the project directory and specify the following values:
BOT_PREFIX="<YOUR_PREFIX>"
BOT_TOKEN="<YOUR_DISCORD_BOT_TOKEN>"
Build and run the application:
npm install
npm run dev
-
Open Discord Developer Portal and sign in if needed.
-
Click the Applications sidebar menu-item and then click on the New Application button.
-
Give your application a name and then click the Create button.
-
Click the Bot sidebar menu-item and then click the Add Bot button.
-
Click the Copy button in the TOKEN section to copy your Bot's token to your clipboard.
NOTE! Keep your token safe, don't share it! -
Replace
<YOUR_DISCORD_BOT_TOKEN>
in the.env
file with the token that you just copied.
-
Click the OAuth2 sidebar menu-item.
- Leave the SELECT REDIRECT URL field blank.
- Check the following boxes under SCOPES:
- Send Messages
- Manage Embeds
- Embed Links
- Read Message History
- View Channels
- Click the Copy button at the bottom of the SCOPES form.
-
Open the copied link in a browser and add the bot to your Discord server.
Build and run the application and then type !ping
in the Discord server. The Bot should reply with pong
.