A Discord bot for the Kristal Discord server.
Warning
This is not meant for public use. The bot is specifically designed for the Kristal Discord server and may not function correctly in other servers.
/ping- Basic status check command to verify the bot is online./tag [name]- Sends a predefined message associated with the given tag name. Tags are static and can only be added or modified in the source.
/timeout [user] [duration] [reason]- Times out a user for the specified duration with an optional reason. The user will be notified via DM./ban [user] [delete_messages] [reason]- Bans a user from the server with an optional reason and the amount of messages to delete. The user will be notified via DM.
/register- Registers the bot's commands globally. The bot does not contain any guild-specific commands.
Timeout (User)- Times out a user for a specified duration with an optional reason. The user will be notified via DM.Timeout (Message)- Times out the author of a specific message for a specified duration with an optional reason. The user will be notified via DM, and the offending message will be included in the notification.Ban (User)- Bans a user from the server with an optional reason and the amount of messages to delete. The user will be notified via DM.Ban (Message)- Bans the author of a specific message from the server with an optional reason and the amount of messages to delete. The user will be notified via DM, and the offending message will be included in the notification.
Tags are predefined messages that can be sent using the /tag command. They use ComponentsV2 and therefore their source is entirely JSON files.
We use discord.builders to create and edit tags.
Under the tags directory in the repository you will find every JSON file representing a tag. For example, the how2ask tag is stored in tags/how2ask.json. Additionally, you can nest tags in subdirectories. For example, tags/rules/1.json is a valid tag, and the ID would be rules/1.
We keep the "source" links generated by discord.builders in tags/sources.txt for easy access. To modify a tag, simply find its link in that file and open it in your browser, modify it, verify it works (by using the webhook test on the site), and then copy the resulting JSON back into the corresponding file. If you add a new tag, PLEASE add the URL to the tags/sources.txt file as well.
If you're having trouble, ask Nyako for help.
The bot will automatically upload any files in the tags/<tag_name>/ directory. For example, how2ask uses two attachments, so the bot automatically attaches tags/how2ask/error.txt and tags/how2ask/GSTR_04131225.png when sending the tag's message.
To use the attachments anywhere in the message (instead of just the end), use Discord's special attachment URI scheme: attachment://<filename>. For example, the image in the how2ask tag is referenced in the JSON as attachment://GSTR_04131225.png.
On the website, you can manually enter the URL, so this is supported fine.
Ask someone in the Discord Developer "Kristal" Team to add bot emotes if you need them. If you're on the team, you can add them yourself by going to the Discord Developer Portal, scrolling to the Kristal team and selecting Tasque Manager, going to the Emojis tab, and uploading the emotes there. Ideally, we shouldn't need this very often, but formatting messages with custom emotes is very useful for presentation.
The bot uses NodeJS. You will need to install all modules (npm install), and then create a .env file with the following variables:
DISCORD_TOKEN="BOT_TOKEN_HERE" # The bot token from the Discord Developer Portal
DISCORD_CLIENT_ID="CLIENT_ID_HERE" # The Client ID of the bot application
DISCORD_OWNER_ID="OWNER_ID_HERE" # The ID of the bot owner (In production, this is always Nyako)
DISCORD_GUILD_ID = "GUILD_ID_HERE" # The ID of the Kristal Discord server
# FORUM STUFF
FORUM_FEATURE_REQUESTS = "FORUM_ID_HERE" # The ID of the Feature Requests forum
TAG_NEEDS_TRIAGE_FEATURE_REQUESTS = "TAG_ID_HERE" # The ID of the "Needs Triage" tag in the Feature Requests forum
ROLE_FEATURE_REQUESTS = "ROLE_ID_HERE" # The ID of the "Feature Requests" role, which gives access to post in the forum
FORUM_BUG_REPORTS = "FORUM_ID_HERE" # The ID of the Bug Reports forum
TAG_NEEDS_TRIAGE_BUG_REPORTS = "TAG_ID_HERE" # The ID of the "Needs Triage" tag in the Bug Reports forum
ROLE_BUG_REPORTS = "ROLE_ID_HERE" # The ID of the "Bug Reports" role, which gives access to post in the forum
# ONE-OFF TRIGGERS:
SEND_FEATURE_REQUESTS_HEADER = "false" # Set to "true" to make the bot send the "header message" in the Feature Requests forum
SEND_BUG_REPORTS_HEADER = "false" # Set to "true" to make the bot send the "header message" in the Bug Reports forum
# TURN THE ABOVE TRIGGERS OFF AFTERWARDS!Please make sure to test the bot before submitting any changes. We recommend you do this by making a testing bot account.