mirror of
https://github.com/sern-handler/website
synced 2026-06-06 01:16:47 +00:00
finish that
This commit is contained in:
@@ -51,9 +51,43 @@ Click on "New Application" in the top right.
|
||||
Then, fill in your application's name:
|
||||

|
||||
|
||||
Click on "Bot" in the sidebar, then the "Reset Token" button and copy the token.
|
||||
Click on "Bot" in the sidebar, then the "Reset Token" button and copy the token. The token should look something like this:
|
||||
```
|
||||
MTE1MjM2MDczNzczMDE5OTU2Mg.GUWUsy.dXAoO6NI1Cy3OV7IA-BTGcyzLS28-9tECNcVOg
|
||||
```
|
||||
|
||||
:::danger
|
||||
Please don't share your discord token (and probably all your other secrets)! Please `gitignore` your `.env` file and keep it safe.
|
||||
:::
|
||||
|
||||
Also scroll down and enable the `Message Content Intent` and `Server Members Intent` so text commands work and discord.js doesn't error out.
|
||||
|
||||
Now, go back to your .env file and add this line:
|
||||
```
|
||||
DISCORD_TOKEN=(your discord token)
|
||||
```
|
||||
What we're essentially doing is defining a new environment variable called `DISCORD_TOKEN` that is set to `(your discord token)`.
|
||||
|
||||
## Inviting your bot to a Discord server.
|
||||
|
||||
This is the last stretch!
|
||||
|
||||
On the sidebar of the Discord Developer Portal, click `OAuth2` and then on `URL Generator`.
|
||||
On scopes, tick only `bot`:
|
||||

|
||||
Then on `Bot permissions` tick `Send Messages` and `Read Message History`. If you need others for your specific use-case, add them here.
|
||||

|
||||
|
||||
Finally, scroll down, copy the generated URL, paste it on the address bar and invite your bot as usual.
|
||||
|
||||
## Starting the bot
|
||||
|
||||
There's an npm script that's called `test`, so we're going to be running that.
|
||||
Execute in your terminal:
|
||||
```
|
||||
yarn test
|
||||
```
|
||||
And your bot should start up in no time! Congrats!
|
||||
|
||||
---
|
||||
Written by [Sr Izan](../intro/who-are-we#ethan)
|
||||
|
||||
Reference in New Issue
Block a user