All Projects → AkimotoRyou → ModMail

AkimotoRyou / ModMail

Licence: AGPL-3.0 License
Discord ModMail Bot

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to ModMail

modmail.js
A Simple Discord Modmail Bot Template
Stars: ✭ 33 (-25%)
Mutual labels:  discord-bot, discord-js, modmail
Komugari
A simple, multi-functional Discord bot written in Discord.js
Stars: ✭ 39 (-11.36%)
Mutual labels:  discord-bot, discord-js
CustomDCBot
Create your own discord bot - Fully customizable and with a lot of features
Stars: ✭ 15 (-65.91%)
Mutual labels:  discord-bot, discord-js
discord-lavalink-music-bot
This is music bot for discord made with erelajs, lavalink, discordjs v13-dev
Stars: ✭ 34 (-22.73%)
Mutual labels:  discord-bot, discord-js
Discord-Selfbot
Discord.js selfbot
Stars: ✭ 24 (-45.45%)
Mutual labels:  discord-bot, discord-js
SataniaBot
The most devilish bot for Discord!
Stars: ✭ 20 (-54.55%)
Mutual labels:  discord-bot, discord-js
Discord-multipurpose-bot
A repository with JavaScript and Python versions of the same type of discord commands.
Stars: ✭ 27 (-38.64%)
Mutual labels:  discord-bot, discord-js
Kato-Bot
discord bot
Stars: ✭ 51 (+15.91%)
Mutual labels:  discord-bot, discord-js
Discord-Reposter
Bot for reposting Discord messages (work in progress)
Stars: ✭ 62 (+40.91%)
Mutual labels:  discord-bot, discord-js
horace
discord.js bot powering the Knights of Academia server with commands like info, AFK, and more
Stars: ✭ 25 (-43.18%)
Mutual labels:  discord-bot, discord-js
Discord-Spammer
Advanced Discord Spammer with multiple options and optional proxys
Stars: ✭ 51 (+15.91%)
Mutual labels:  discord-bot, discord-js
deejay-stereo
Discord music bot built using djs v13, discord-player. Slash Commands only bot
Stars: ✭ 42 (-4.55%)
Mutual labels:  discord-bot, discord-js
NSFW-Bot
NSFW Bot is an open-source discord bot that has nsfw commands with the nekobot.xyz api.
Stars: ✭ 43 (-2.27%)
Mutual labels:  discord-bot, discord-js
Nereus
A multipurpose discord bot with a focus on music written using Discord.js
Stars: ✭ 46 (+4.55%)
Mutual labels:  discord-bot, discord-js
lavamusic
lavalink music bot base in erela.js and discord.js v13
Stars: ✭ 210 (+377.27%)
Mutual labels:  discord-bot, discord-js
lecashbot
A Discord.js economy bot based on the NitroType currency made with JavaScript.
Stars: ✭ 18 (-59.09%)
Mutual labels:  discord-bot, discord-js
delet
[DEPRECATED - see README.md] a Discord bot made using Discord.js
Stars: ✭ 46 (+4.55%)
Mutual labels:  discord-bot, discord-js
ALi
ALi a powerful Discord bot that includes Utility, Fun, Music, Moderation, and much more! (Beta)
Stars: ✭ 97 (+120.45%)
Mutual labels:  discord-bot, discord-js
discord-supervisor-bot
An advanced Discord supervisor bot.
Stars: ✭ 53 (+20.45%)
Mutual labels:  discord-bot, discord-js
TundraBot
All-in-one Discord bot
Stars: ✭ 49 (+11.36%)
Mutual labels:  discord-bot, discord-js

ModMail - Discord Bot

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 moderator and user to address an issue by acting as a bridge between user DM channel and new temporary channel inside a thread server.

Disclaimer

This bot only support one pair of server per bot, one main server and one thread server. I'm debugging the bot alone so expect some bugs passed to GitHub, and if you encounter bugs report here.

Notes

This is a complete rewrite of previous version. This version of the bot use Replit nix to meet node version requirement for Discord.Js v13 to host it in Replit and it's still in beta version. This bot use slash command and currently can't receive file attachment as an input due Discord API limitation. It's still a planned feature for slash command option as stated in this link. Global slash commands need up to an hour to register properly.

Requirements

  • Node.js v16.6.0 or higher
  • Npm v7.0.0 or higher

Installation

I. Setting up the bot

  1. Create a discord bot.
  2. While still in discord developer page, scroll down to Privileged Gateway Intents section and turn on Server Members Intent.
  3. Invite the bot to your server with following scopes and permissions.
    • Required scopes: bot, application.commands.
    • Required permissions: Manage Roles, Manage Channels, Read Messages/View Channels, Send Messages, Embed Links, Attach Files, Read Message History, Mention Everyone

If you don't understand Discord permissions rules, either give the bot Administrator permission or read this guide.

You'll need to re-invite the bot with correct scopes if you get "Missing Access" error.

II. Preparing the source code

  1. Download latest source code here and extract it.
  2. Copy your bot token from discord developer page.
  3. Open .env file and paste your bot token right after the equal sign on TOKEN= and save the file. e.g. TOKEN=YourBotTokenHere
  4. Copy your discord User ID.
  5. Open defaultConfig.json file and paste your discord user id inside double quotes "" character that are after "ownerID": and save the file. e.g. "ownerID": "YourUserIdHere"

Setting ownerID is recommend since it'll limit who can use critical commands.

III. A. Replit

  1. Create Replit account and login.
  2. Click + Create Repl button.
  3. Choose Nix (beta) as template, and then click + Create Repl.
  4. Go to your source code folder and select all the files.
  5. Drag and drop them to Files pane on Replit and click replace.
  6. Go to Replit shell (ctrl+shift+s) and run npm install command.
  7. If the installation finished without any error, click Run button at the top of Replit page and your bot should be online.

III. B. Non Replit User

ReplDB show an error when used outside Replit. Follow this instruction to change the database.

  1. Open DB.js file from functions folder, comment ReplDB section and uncomment Sequelize section.
  2. Delete or rename current package.json file.
  3. Rename sequelize-package.json file to package.json.
  4. Open terminal from the main folder and run npm install command.
  5. If the installation finished without any error, run npm start command from the terminal.

IV. Setting up the bot

  1. Prepare the following stuff before proceed:
    • Main Server : Server that are moderated by moderator. The bot need to be inside the server too.
    • Thread Server : Server where thread channels will be created. The bot need to be inside the server too.
    • Category Channel : Category channel that will hold thread channels. Need to be inside Thread Server.
    • Log Channel : Channel where thread logs will be sent. Need to be inside Thread Server.
    • Admin Role : Role that will have administrator permission level. Need to be inside Thread Server.
    • Moderator Role : Role that will have moderator permission level. Need to be inside Thread Server.
    • Mentioned Role : The role that will be mentioned on new thread. Need to be inside Thread Server. *Optional
  2. Mention the bot followed by setup message to start bot setup and reply to the bot message to proceed. e.g. @ModMail setup

V. Setting up UptimeRobot

If you have Replit Hacker Plan, turn your Replit project to always on and ignore this part of instruction.

You can also skip this part if you aren't hosting it on Replit.

  1. Create UptimeRobot account and login.
  2. Go to Dashboard and click + Add New Monitor button.
  3. Select HTTP(s) for Monitor Type and fill the name section.
  4. Copy your Replit project webserver link and paste it to URL section. e.g. https://projectName.replUsername.repl.co
  5. Set the Monitoring Interval to 30 minutes and then click Create Monitor button at the bottom.

Adding another Language

  1. Go to locale folder.
  2. Copy template.txt and rename it to designated language name and change the file type to javascript .js.
  3. Fill the empty quotes "" with the translation while using en.js as reference.
  • Notes :
    • I recommend to only have up to two language per bot to make cleaner user experience.
    • User experience would be better if you have different bot for different language.
    • Most of message command response are hard coded so it won't be affected.
    • Make sure the name property is same as the filename. e.g. en.js name: "en"
    • Make sure there's no same command name within and between language as it will throw an error when deploying the command.
    • Make sure to not leave any property value empty since it might trigger an error.

Command List

Slash Commands

*Global Command **Optional

Name Operation Description Usage
/block info Show specified user information /block operation:info target:userID
list Show blocked users list /block operation:list page:number**
add Block specified user /block operation:add target:userID reason:blockReason
set Edit specified user blocking reason /block operation:set target:userID reason:newReason
remove Remove specified user from blocked list /block operation:remove target:userID
/close - Close an active thread /close reason:closeReason note:threadNote** anon:true**
/config view Show current bot configuration /config operation:view
info Show specified config information /config operation:info target:configName
set Edit specified config value /config operation:set target:configName value:newValue
reset Reset specified or all config value /config operation:reset target:configName
/create* - Create new thread /create title:threadTitle
/help* - Show specified command information /help target:commandName
/ping - Calculate bot latency /ping
/reply* - Reply an active thread /reply content:message anon:true
/tag view Show a saved response /tag operation:view target:tagName show:true**
sent Sent a saved response to an active thread /tag operation:sent target:tagName
info Show tag information /tag operation:info target:tagName
list Show tag list /tag operation:list page:number
add Create new saved response /tag operation:add target:tagName content:tagContent
set Edit a saved response content /tag operation:set target:tagName content:newContent
remove Remove specified tag /tag operation:remove target:tagName
/thread info Show specified thread information /thread operation:info user:targetUser
/thread operation:info channel:targetChannel
list Show thread list /thread operation:list page:number**
bind Bind a user thread to a channel /thread operation:bind user:targetUser channel:targetChannel title:threadTitle**

Message Commands

If ownerID are set, only owner can use these commands.

⚠️ If ownerID are empty but mainServerID or threadServerID are set, only admin from those servers can use these commands.

⚠️ If ownerID, mainServerID, and threadServerID are empty, any admin from any server can use these commands.

Name Description Usage
config Show current bot config @ModMail config
deploy Deploy slash commands @ModMail deploy
guilds Show list of guilds(servers) the bot in @ModMail guilds
leave Leave specified guild(server) @ModMail leave guildID
reload Reload specified command, function, or locale file @ModMail reload targetName
reset Reset all or specified config value @ModMail reset all
@ModMail reset configName
set Edit specified config value @ModMail set configName configValue
setup Set required bot config and deploy slash command @ModMail setup

Testing

I made Discord server to test the bot, feel free to join at https://discord.gg/bzG7AqcRyC.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].