Configure Modmail and Logviewer
Log Viewer
To be able to store data such as logs, you will need to use your own database.
Modmail supports MongoDB, and you are required to provide a MongoDB connection URI to the bot. You can get a free 500MB cluster from MongoDB Atlas. (Enough to store 3 million messages)
Upon creating an account, you will be greeted with this page:
Select one of the servers marked with "FREE TIER AVAILABLE" for the free option and click on "Create Cluster".
Follow the "Getting Started" tutorial on the bottom left, by creating a database user, whitelisting your IP, and connect to the cluster. When whitelisting you IP, be sure to select ALLOW ACCESS FROM ANYWHERE since Heroku does not grant a fixed IP.
Your IP should look something like this, with 0.0.0.0/0
:
This will show a URI under "Copy the SRV address:", copy that, and replace <PASSWORD>
with the database user password (not your account password). The final URI should look something like this:
If your URI is followed by test?retryWrites=true
or anything else, don't include it.
Deploying the Log Viewer
You will also need to deploy another separate log viewer application from this repo. Click on the deploy button over there and fill in the configurations upon request. This is a separate Heroku application from the bot and is a simple website that will be used to display your thread logs.
Modmail
Star the repository before you start 😉
Input a name of your choice for your app, the Heroku app name is not important.
Input your bot token into the
TOKEN
field.Put the ID of your Server into the
GUILD_ID
field.Put your own ID in the
OWNERS
field (if there are multiple owners, separate them by a comma:123455,234567,456782
).Input your MongoDB connection URI from the previous section into the
MONGO_URI
field.Input the URL of your log viewer Heroku app (
https://yourlogviewerappname.herokuapp.com
) into theLOG_URL
field.Click the
deploy app
button and wait for it to finish.Click
Manage App
and go into theResources
tab.Now turn on the worker by clicking the pencil icon.
If you want, you can go over and check the application logs to see if everything is running smoothly.
Once the bot is online in your server, do
[your prefix]setup
(defaults?
) and you are good to go!
Your bot is ready! Head over to Discord and try it out! If you have any issues, join the Discord server.
Make sure to give the bot Manage Channels, Manage Messages and View Audit Logs permissions!
Last updated