Simple ModMail Discord bot designed for a small server and people that want to maintain their own ModMail bot in discord. ModMail is a bot that create a private space between support staff and user to address an issue by creating a new channel.
This bot only support one pair of server per bot. One main server(where users gather and chatting) and one thread server(where all the threads channel made). I'm debugging the bot alone so some bugs might passed when i upload it on GitHub feel free to report those bugs here.
- Set up bot application in Discord.
- Don't forget to turn on
Server Members Intent
on Discord Developer Portal. - Download or clone files in this repository.
- Edit
.env
file, and add your bot token right afterTOKEN=
. - Create Repl.it account.
- Click on
+ New repl
. - Choose
Node.js
as the language. - Rename your project.
*(Optional)
- Click
Create Repl
. - Delete Replit prebuilt index.js file.
- Drag and drop all the
(downloaded or cloned from github)
files to the box belowFiles
on left side of the repl.it project page. - Run
npm i @replit/database
from shell(ctrl+shift+s)
. - At
config.json
file, add your DiscordID between""
character atbotOwnerID
section. - Click
Run
button on top center of the page. - If you have repl.it Hacker subscription when the
Always-on repls
feature added, you can skip the instructions below. - Create UptimeRobot account and login.
- On Dashboard, click
+ Add New Monitor
. - Change
Monitor Type *
toHTTP(s)
. - Fill the name to your own liking.
- On your Repl.it project, there should be a window showing a page that says
Bot is running.
copy the url on that window to UptimeRobotURL (or IP)*
part.*(The url should be something like: "https://projectName.replUsername.repl.co")
- Set the
Monitoring Interval *
to anything between 5 minutes and 45 minutes(Recomended: 30 minutes)
. - Finally, click
Create Monitor
.
- Copy
en.js
insidelocale
folder. - Rename it to designated language that you going to add.
- Translate it's content inside.
- Upload it inside
locale
folder on your Replit project. - Reload the bot.
- Make sure the language name is same as the file name without the file type so that you can use reload command on it.
- Don't delete or leave an empty message as it'll throw an error.
To operate functionally the bot need the following :
- Administrator Permission : Somehow
Manage Roles
permission isn't enough to create a new channel that inherit a category channel permissions. - Dedicated Category Channel : Instead of setting a new permission everytime the bot create new channel, it used the same permission from this category channel. You can read here if you don't know what category channel is.
- Dedicated Text Channel : To log a new thread and closed thread.
- leave : Leave a guild (server).
- reload : Reload a command.
- turnoff : Turn off the bot.
- bind : Bind user thread to a channel.
- config : Show current bot config or info about each config.
- guilds : List of guilds (servers) that have this bot.
- reset : Reset specific or all configuration values.
- set : Set specific configuration value.
- aclose : Anonymously close a user thread.
- areply : Anonymously reply to a user thread.
- block : Block a user, show an info, or show list of blocked user(s).
- close : Close a user thread.
- reply : Reply to a user thread.
- tag : Send, add, delete, edit, show an info or show list of saved response(s).
- thread : Show a user thread information or list of open thread(s).
- unblock : Unblock user from creating new thread.
- commands : List of all available commands according to your permission level.
- help : Short instruction on how to create a new thread or info on a specific command.
- new : Create new thread.
- ping : Calculate bot latency.
I made Discord server to test the bot, feel free to join at https://discord.gg/bzG7AqcRyC.
- Tag command now can be triggered without using a command name, you can just use:
<prefix><tag name>
. And now the bot won't respond if the tag name didn't exist. - Add manual localization, now you can add multiple language that the bot can support, you'll need to manually translate it, check the instruction above. I was thinking of using a translation package but the translation won't be perfect and we won't be able to fix it ourself.
- Add language config, you can change the default language the bot will use. It'll only affect non command based action such as bot activity, user reply, guild join, etc.
- Cycling activity are deleted, and will use the configured language as it's base.