- TypeScript 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| src | ||
| .env | ||
| .gitignore | ||
| bun.lock | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
viobot-discord
Source code for Viobot, a Discord bot created for violetmillie.me's Discord community, focusing on providing the essentials to manage a guild.
Deployment
This section is written to be accessible to all users, so it covers every step.
The Discord Application
-
Create a new Discord Application in the developer portal. The name of the application will be used for the bot, but can be changed later.
-
Copy the 'Application ID' and paste it into the .env file. It should look like this:
APPLICATION_ID=THE_APPLICATION_ID_YOU_PASTED
DISCORD_TOKEN=
- Head over to the 'bot' section (Left side panel: Overview > Bot) and copy the token (you must reset it to view it!), and copy it into the .env file.
It should now look like this:
APPLICATION_ID=THE_APPLICATION_ID_YOU_PASTED
DISCORD_TOKEN=THE_TOKEN_YOU_PASTED
-
If you are hosting the bot just for yourself, you should disable 'Public Bot' in the bot's page.
-
Under 'Privileged Gateway Intents' enable 'Server Members Intent' (it allows to bot the view members of the guild).
Running the bot
Running the bot requires what we call a "runtime", it is simply a program able to run the files.
We have developed the bot using Bun which is able to run TypeScript files without friction, and will continue the guide using it.
-
Install Bun if you haven't already done so, visit https://bun.sh/ and follow the install instructions for your operating system.
-
Get the code. You can do so using Git, or by downloading an archive of the source code (see 2.2).
2.1 With Git:
$ git clone https://code.queersynergy.com/VioletMillie/discord-viobot.git && cd discord-viobot2.2 Using an archive:
-
Download the source code archive: https://code.queersynergy.com/VioletMillie/discord-viobot/archive/main.zip
-
Extract the files to wherever you like.
-
From the terminal, cd into the extracted folder
i.e:
cd ~/Downloads/discord-viobot
-
-
Run
bun installin order to install the bot's dependencies. This step should be automatic and not raise any errors. -
Invite the bot to your server. You can run the command
bun inviteto retrieve an invitation link. -
You can now run the bot using
$ bun bot.
Configuration
At the time of writing, all the configuration is hard coded, and you must either modify the code yourself or have you Discord guild set up in accordance to the code.
This will change once the main codebase is complete, and you will be able to configure it using commands on Discord.
Verification
-
The bot expects a channel '#verification' to exist with the correct permissions.
-
The bot expects a role called 'verified' to exist with the correct permissions.
Stream notifications
- SoonTM