In windows operating system, you need to download the windows build tools to be able to host this bot. Open a command prompt / powershell with Administrator privileges and run the following command:
npm install --global --production windows-build-tools
- Create an empty .env file on the directory
- Go to Mongo DB Atlas and create a free account. Create a free tier sandbox/database and get your connection URI. Make sure you whitelist the IP address from where your bot tries to connect. Paste the generated connection uri to your .env file under the key "MONGO_URI".
- Go to Discord Developer Portal and create a bot. Select new Application -> Navigate to the Bot section and click generate token. Copy this token to your .env file under the key "DISCORD_TOKEN".
- Go to your discord server, right click on the icon of your server, and select copy id and paste this id to your .env file under the key "GUILD_ID".
- Go to your server settings, create a new role. This role will allow the user to create, edit, and delete tags in your server. copy the role id and paste this id on your .env file under the key "AUTHORIZED_ROLE".
- Overall, your env file should look similar to this: (asterisks indicate sensitive information)
MONGO_URI=mongodb+srv://super_hideous_user:super_secret_password@cluster0.****.mongodb.net/*********?retryWrites=true&w=majority
DISCORD_TOKEN=NTk5Mjc0MzY1NTAyMDk1Mzcw.XSizvg.ecj2ZM5jy68kPWKhY**********
GUILD_ID=59002493**********
AUTHORIZED_ROLE=83276051**********
- Invite your bot to your server bearing the
bot
andapplication.commands
scopes. Generate the invlite link in the OAuth2 URL Generator under the OAuth2 category. - Install the dependencies through
npm install
and launch the bot via the commandnode index.js
on terminal.
Run the following command on your CLI
npm install
npm start
Note: Heroku only provides 550 free dyno hours, which means if you're running the bot 24/7, the bot will stop working starting on every 25th of the month, although it reboots itself again automatically every 1st day of the month. Small price to pay for a free bot!
- Fork this repository.
- Go to Heroku login page and make a free account (or login an account if you already have one).
- Make a new app. Follow the process throughout.
- On your new app, go to the
Settings
tab. - Scroll down until you reach the Config Vars section, click Reveal Config Vars.
- Instead of the keys and values found on your env file, add those config vars here. (for example, put GUILD_ID to key and the actual id to value, you need to do this one by one)
- Save the config vars.
- Go to
Deploy
tab. - Connect your github account on the deployment method.
- Connect to your fork of this repository.
- Click on Deploy Branch.
- Go to
Resources
tab. - Disable
web
and enableworker
. - If the bot doesn't start, redeploy the branch (repeat step 7).
Tags are short articles that aims to explain something to a user through a catchphrase/word, which is known as tag. They are useful on support servers who constantly replies the same answer over and over again for different users. Tag aims to reduce the response time from the devs since it allows regular users to use them as well. If devs aren't around, regular users may help point out the answer by using tags generated by the support team themselves.
The image above shows how a tag can be used. Developers created the tag to ease response times to most common questions. Taken from Discord.JS official support server.
To add a tag, use the command tag add [name of the tag] [response]
.
tag add drivequota Follow the following steps to bypass download quota exceeded error:
1. Sign in to Google Drive account after opening the file link.
2. Replace the “uc” with “open” in the file URL.
3. Reload the page and bypass download quota exceeded error.
4. Click the Add to My Drive icon.
5. Select the same option again to confirm.
The command above successfully created a new tag. Whenever a user types /drivequota on chat, the bot will respond like that.
You can also add a flavor text with discord-supported markdown, including bold, italics, underline, and hyperlink to name a few. To add hyperlink, use the format [word](uri reference). Embeds are supported aswell. If you don't know how to build one, go here.
Make sure your JSON syntax is correct before setting it on a tag. Check its validity here
To delete a tag, simply use the command tag delete [name of the tag]
.
You can edit a tag's response
, description
, and if it's ephemeral
.
To edit it, use the command tag edit [name of the tag] response [new response]
To edit it, use the command tag edit [name of the tag] description [new description]
An example of the discord slash command UI displaying the tag description underneath
Description must not exceed 100 characters in length
To make a tag ephemeral or not, use the command tag edit [name of the tag] ephemeral [true or false]
This does not work with Message Embed responses
- Number of tags cannot exceed 100.
- Tag Description must not exceed 100 characters.
Description | Command |
---|---|
Add a tag | tag add [tag name] [response] |
Delete a tag | tag delete [tag name] |
Edit a tag's response | tag edit [tag name] response [new response] |
Edit a tag's description | tag edit [tag name] description [new description] |
Make a tag ephemeral | tag edit [tag name] ephemeral true |
Make a tag not ephemeral | tag edit [tag name] ephemeral false |
Sync tag to the database | tag sync (May cause some tags to be deleted if db is not synced / Use only for debugging) |