diff --git a/.gitbook/assets/27-272811_containerization-docker-explained-edureka-docker-explanation-hd-png-1221238558.png b/.gitbook/assets/27-272811_containerization-docker-explained-edureka-docker-explanation-hd-png-1221238558.png new file mode 100644 index 0000000..5373035 Binary files /dev/null and b/.gitbook/assets/27-272811_containerization-docker-explained-edureka-docker-explanation-hd-png-1221238558.png differ diff --git a/.gitbook/assets/Screenshot 2023-04-13 224748.png b/.gitbook/assets/Screenshot 2023-04-13 224748.png new file mode 100644 index 0000000..33fea16 Binary files /dev/null and b/.gitbook/assets/Screenshot 2023-04-13 224748.png differ diff --git a/.gitbook/assets/image (1).png b/.gitbook/assets/image (1).png new file mode 100644 index 0000000..8284bbe Binary files /dev/null and b/.gitbook/assets/image (1).png differ diff --git a/.gitbook/assets/image (10).png b/.gitbook/assets/image (10).png new file mode 100644 index 0000000..1ec2349 Binary files /dev/null and b/.gitbook/assets/image (10).png differ diff --git a/.gitbook/assets/image (11).png b/.gitbook/assets/image (11).png new file mode 100644 index 0000000..35e12a7 Binary files /dev/null and b/.gitbook/assets/image (11).png differ diff --git a/.gitbook/assets/image (2).png b/.gitbook/assets/image (2).png new file mode 100644 index 0000000..3e14d7d Binary files /dev/null and b/.gitbook/assets/image (2).png differ diff --git a/.gitbook/assets/image (3).png b/.gitbook/assets/image (3).png new file mode 100644 index 0000000..cf836a9 Binary files /dev/null and b/.gitbook/assets/image (3).png differ diff --git a/.gitbook/assets/image (4).png b/.gitbook/assets/image (4).png new file mode 100644 index 0000000..7c81374 Binary files /dev/null and b/.gitbook/assets/image (4).png differ diff --git a/.gitbook/assets/image (5).png b/.gitbook/assets/image (5).png new file mode 100644 index 0000000..239739c Binary files /dev/null and b/.gitbook/assets/image (5).png differ diff --git a/.gitbook/assets/image (6).png b/.gitbook/assets/image (6).png new file mode 100644 index 0000000..cb0a966 Binary files /dev/null and b/.gitbook/assets/image (6).png differ diff --git a/.gitbook/assets/image (7).png b/.gitbook/assets/image (7).png new file mode 100644 index 0000000..239739c Binary files /dev/null and b/.gitbook/assets/image (7).png differ diff --git a/.gitbook/assets/image (8).png b/.gitbook/assets/image (8).png new file mode 100644 index 0000000..506b876 Binary files /dev/null and b/.gitbook/assets/image (8).png differ diff --git a/.gitbook/assets/image (9).png b/.gitbook/assets/image (9).png new file mode 100644 index 0000000..675b82d Binary files /dev/null and b/.gitbook/assets/image (9).png differ diff --git a/.gitbook/assets/image.png b/.gitbook/assets/image.png new file mode 100644 index 0000000..fa6c230 Binary files /dev/null and b/.gitbook/assets/image.png differ diff --git a/README.md b/README.md index f8cd360..d0598b2 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ This bot is free for everyone and always will be. If you like this project and w ## What is Modmail used for? -When a member sends a direct message to Modmail, the bot will create a channel (we call it a "thread") into a designated category. All further DM messages will automatically relay to that channel, then any available staff can respond within the channel. Compared to ticketing bots, Modmail allows easier and more organised discussions among staff. +When a member sends a direct message to Modmail, the bot will create a channel (we call it a "thread") into a designated category. All further DM messages will automatically relay to that channel, then any available staff can respond within the channel. Compared to ticketing bots, Modmail allows easier and more organised discussions among staff.

An example of a Modmail thread.

@@ -52,11 +52,11 @@ Visit our [installation page](installation/) for detailed instructions on settin ## Supporting the project -You have various options to help the project. Giving this repository a star is greatly appreciated. You can also help people that have trouble setting up Modmail at our [Discord server](https://discord.gg/cnUpwrnpYb). +You have various options to help the project. Giving this repository a star is greatly appreciated. You can also help people that have trouble setting up Modmail at our [Discord server](https://discord.gg/cnUpwrnpYb). If you like to show your appreciation, consider supporting us on [**Patreon**](https://www.patreon.com/kyber)! -### Contributing +## Contributing Support Modmail with your contributions! Whether it be improvements to the documentation or new functionality, please feel free to make the change. Check out our [contributing guidelines](https://github.com/modmail-dev/modmail/blob/master/.github/CONTRIBUTING.md) before you get started. @@ -65,5 +65,12 @@ Support Modmail with your contributions! Whether it be improvements to the docum * Read about [installing Modmail](installation/). * Become familiar with [Modmail commands and functionalities](getting-started.md). - -{% hint style="info" %} In this guide when we refer to bot commands, we will assume the prefix to be `?` and will display them like in this example. `?help`. Optional arguments will be in [brackets], for example `?close [time] [reason] [silently].` Required arguments will be put in , for example `?permissions add ` {% endhint %} +{% hint style="info" %} +Throughout this documentation when we're referring to bot commands, we will assume the prefix of the bot to be ? and will display them like in this example: ?help.\ +\ +Optional arguments will be enclosed in square brackets:\ +Example: ?close \[time] \[reason] \[silently]\ +\ +Required arguments will be enclosed in angle brackets:\ +Example: ?contact \ +{% endhint %} diff --git a/SUMMARY.md b/SUMMARY.md index 1a1ed04..f31376f 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -9,29 +9,31 @@ * [Ubuntu](installation/local-hosting-vps/ubuntu.md) * [Debian](installation/local-hosting-vps/debian.md) * [Fedora](installation/local-hosting-vps/fedora.md) - * [AlmaLinux](installation/local-hosting-vps/almalinux.md) - * [CentOS](installation/local-hosting-vps/centos.md) - * [Raspberry Pi](installation/local-hosting-vps/raspberry-pi.md) + * [Alma Linux](installation/local-hosting-vps/almalinux.md) + * [Logviewer](installation/local-hosting-vps/logviewer.md) + * [Patreon logviewer](installation/local-hosting-vps/patreon\_logviewer.md) * [Railway](installation/railway.md) * [Heroku](installation/heroku.md) - * [Replit](installation/replit.md) * [Community Guides](installation/community-guides.md) +* [Setting up auto-restart](setting-up-auto-restart.md) +* [Updating](updating.md) +* [Getting Started](getting-started.md) * [Usage](usage-guide/README.md) * [Plugins](usage-guide/plugins.md) * [Configuration](usage-guide/configuration.md) * [Permissions](usage-guide/permissions.md) -* [Getting Started](getting-started.md) +* [Frequently Asked Questions](frequently-asked-questions.md) * [OLD DOCS](old-docs/README.md) * [Installation](installation-1.md) * [Installation (continued)](installation-continued.md) * [Color Names](color-names.md) * [Configuration Variables (Config Vars)](configuration-variables-config-vars.md) * [Configure Modmail and Logviewer](configure-modmail-and-logviewer.md) - * [Frequently Asked Questions](frequently-asked-questions.md) + * [Frequently Asked Questions]() * [Modmail Usage](modmail-usage.md) * [Permissions](permissions.md) * [Plugins](plugins.md) * [Seperate Server Setup](seperate-server-setup.md) * [The Unofficial List of Plugins](the-unofficial-list-of-plugins.md) - * [Updating](updating.md) + * [Updating]() * [Video Tutorials](video-tutorials.md) diff --git a/frequently-asked-questions (1).md b/frequently-asked-questions (1).md new file mode 100644 index 0000000..e39b59f --- /dev/null +++ b/frequently-asked-questions (1).md @@ -0,0 +1,53 @@ +# Frequently Asked Questions + +> Last Updated: March 16, 2023 + +#### What is Modmail? + +Modmail is a Discord bot, similar to Reddit's Modmail feature. It serves as a shared inbox for server staff to communicate with their users - and vice versa - in a seamless way. + +#### Can I invite Modmail? + +Unfortunately, due to the nature of the bot, there is not a global invite link. Nonetheless, you can obtain a free copy of Modmail for your server. Follow the official tutorial at [https://github.com/modmail-dev/modmail/wiki/Installation](https://github.com/modmail-dev/modmail/wiki/Installation). However, if you don’t want the hassle of installing and maintaining Modmail, we offer installation, hosting, and other cool perks for [Patrons](https://patreon.com/kyber). + +#### How does Modmail work? + +Modmail uses the Discord API to interact with the platform. When someone sends a DM to the bot, it will create a new thread. Members of the moderation team can help the user and once the conversation ended, you will have access to a beautiful log of it online. + +#### Is Modmail safe? + +Your Modmail bot is safe as long as you don't share your bot's token. If you share your token, a "hacker" can take control over your bot. If you shared your bot token by mistake, regenerate a new token via the Discord Developer Portal. + +#### Where is my data stored? + +All your data including settings, blocked users, logs, installed plugins etc. are stored in your MongoDB database. The bot files only contain the stuff needed to run the bot. This means you can move your bot to a different host and still have your data intact, as long as you use the same MongoDB URI. + +#### Can I request new features? + +Modmail is an open-source project, which means you can easily add or request new features. You can make an issue or submit a pull request to the development branch on the repository. [Check out the contribution guidelines.](https://github.com/modmail-dev/modmail/blob/master/CONTRIBUTING.md) + +#### How do I become a support member? + +To join our support team, join our [Discord server](https://discord.gg/cnUpwrnpYb). One of the more experienced members will hold an interview to check if you fit the requirements. + +#### Can I add commands to the bot? + +You can add commands to the bot using plugins. All currently approved plugins can be found in the `?plugin registry` command. You can also see [this page](https://github.com/modmail-dev/modmail/wiki/Unofficial-List-of-Plugins) for an unofficial list of plugins. + +#### My bot is offline, what do I do? + +Join our [Discord server](https://discord.gg/cnUpwrnpYb) and DM Modmail. One of our support members will assist you and help you fix the issue. + +#### How can I donate the developers? + +You can support the developers on the [Patreon page](https://patreon.com/kyber). You will also receive various rewards for it. + +#### Does anyone get any info when I create my own modmail? + +There is not much information we get about your instance of modmail, The only thing what we recieve is the guild-info, For example: The guildname, The amount of members of the guild, the botname, and the bot-owner. Using this we keep track of how many modmail-instances get created on a monthly/yearly base. ( Only modmail-developers can see this ) + +*** + +#### Answer not found? + +Feel free to join our [Discord server](https://discord.gg/cnUpwrnpYb). People will gladly help you with any questions that you have! diff --git a/frequently-asked-questions.md b/frequently-asked-questions.md index e39b59f..a832ca8 100644 --- a/frequently-asked-questions.md +++ b/frequently-asked-questions.md @@ -1,53 +1,27 @@ -# Frequently Asked Questions - -> Last Updated: March 16, 2023 - -#### What is Modmail? - -Modmail is a Discord bot, similar to Reddit's Modmail feature. It serves as a shared inbox for server staff to communicate with their users - and vice versa - in a seamless way. - -#### Can I invite Modmail? - -Unfortunately, due to the nature of the bot, there is not a global invite link. Nonetheless, you can obtain a free copy of Modmail for your server. Follow the official tutorial at [https://github.com/modmail-dev/modmail/wiki/Installation](https://github.com/modmail-dev/modmail/wiki/Installation). However, if you don’t want the hassle of installing and maintaining Modmail, we offer installation, hosting, and other cool perks for [Patrons](https://patreon.com/kyber). - -#### How does Modmail work? - -Modmail uses the Discord API to interact with the platform. When someone sends a DM to the bot, it will create a new thread. Members of the moderation team can help the user and once the conversation ended, you will have access to a beautiful log of it online. - -#### Is Modmail safe? - -Your Modmail bot is safe as long as you don't share your bot's token. If you share your token, a "hacker" can take control over your bot. If you shared your bot token by mistake, regenerate a new token via the Discord Developer Portal. +--- +description: A list of commonly asked questions or problems related to Modmail. +--- -#### Where is my data stored? - -All your data including settings, blocked users, logs, installed plugins etc. are stored in your MongoDB database. The bot files only contain the stuff needed to run the bot. This means you can move your bot to a different host and still have your data intact, as long as you use the same MongoDB URI. - -#### Can I request new features? - -Modmail is an open-source project, which means you can easily add or request new features. You can make an issue or submit a pull request to the development branch on the repository. [Check out the contribution guidelines.](https://github.com/modmail-dev/modmail/blob/master/CONTRIBUTING.md) - -#### How do I become a support member? - -To join our support team, join our [Discord server](https://discord.gg/cnUpwrnpYb). One of the more experienced members will hold an interview to check if you fit the requirements. - -#### Can I add commands to the bot? - -You can add commands to the bot using plugins. All currently approved plugins can be found in the `?plugin registry` command. You can also see [this page](https://github.com/modmail-dev/modmail/wiki/Unofficial-List-of-Plugins) for an unofficial list of plugins. - -#### My bot is offline, what do I do? +# Frequently Asked Questions -Join our [Discord server](https://discord.gg/cnUpwrnpYb) and DM Modmail. One of our support members will assist you and help you fix the issue. +### I tried installing the dependencies with another Python version and it messed up my Pipfile! How can I get the original Pipfile back? -#### How can I donate the developers? +First remove the broken `Pipfile` and `Pipfile.lock` with: -You can support the developers on the [Patreon page](https://patreon.com/kyber). You will also receive various rewards for it. +```bash +rm Pipfile && rm Pipfile.lock +``` -#### Does anyone get any info when I create my own modmail? +Fetch in the changes from the remote repository: -There is not much information we get about your instance of modmail, The only thing what we recieve is the guild-info, For example: The guildname, The amount of members of the guild, the botname, and the bot-owner. Using this we keep track of how many modmail-instances get created on a monthly/yearly base. ( Only modmail-developers can see this ) +```bash +git fetch origin +``` -*** +And then, fetch the original files with: -#### Answer not found? +```bash +git checkout FETCH_HEAD -- Pipfile && git checkout FETCH_HEAD -- Pipfile.lock +``` -Feel free to join our [Discord server](https://discord.gg/cnUpwrnpYb). People will gladly help you with any questions that you have! +### diff --git a/installation/README.md b/installation/README.md index dd45d92..e60065a 100644 --- a/installation/README.md +++ b/installation/README.md @@ -4,24 +4,24 @@ description: Modmail hosting and installation guide. # Installation -Modmail is a self-hosted bot. This unfortunately means that there's **no** public bot invite. Furthermore, due to the inner workings of the bot and its highly customisable interfaces, you will need to host your own dedicated Modmail bot. +Modmail is a self-hosted bot. This unfortunately means that there's **no** public bot invite. Furthermore, due to the inner workings of the bot and its highly customisable interfaces, you will need to host your own dedicated Modmail bot. -This section provides setup instructions for Modmail on many hosting methods, both **free\* and paid**. +This section provides setup instructions for Modmail on many hosting methods, both **free\* and paid**. -\*Some free options require a credit card for verification. +\*Some free options require a credit card for verification. Here are the basic requirements for hosting your Modmail bot. You will find instructions on obtaining and using them in later sections. -* A Discord account. +* **A Discord account.** You will need to create a Discord bot under your account. -* A MongoDB database instance. +* **A MongoDB database instance.** Modmail will store its internal data to this database. -* A hosting server. +* **A hosting server.** To keep Modmail running 24/7 in your server. -* A Desktop Notepad, Notes, TextEdit, etc. +* **A Desktop Notepad, Notes, TextEdit, etc.** Anywhere you can copy and paste to temporary store some texts while we set up the bot. @@ -31,7 +31,7 @@ Here are the basic requirements for hosting your Modmail bot. You will find inst ## Create a Discord bot -The first step in setting up Modmail is to create a Discord bot. +The first step in setting up Modmail is to create a Discord bot. Head over to the [**Discord Developer Portal**](https://discordapp.com/developers/applications/) and create a new application. @@ -99,15 +99,15 @@ Navigate back to the **General Information** tab and copy the application ID.
Screenshot of copying the application ID on the general information tab.

Click Copy to copy the application ID. This is also known as your "Bot ID".

-Using the following URL as template, replace `YOUR-ID-HERE` with the ID you just copied. Do not change anything else! Open a new browser tab and go to that URL. +Using the following URL as template, replace `YOUR-ID-HERE` with the ID you just copied. Do not change anything else! Open a new browser tab and go to that URL. {% code overflow="wrap" %} -``` +```url https://discord.com/oauth2/authorize?scope=bot&permissions=416075476184&client_id=YOUR-ID-HERE ``` {% endcode %} -Discord should prompt you to choose a server to invite your bot, followed by a list of permissions. Scroll to the bottom and click **Authorize**. +Discord should prompt you to choose a server to invite your bot, followed by a list of permissions. Scroll to the bottom and click **Authorize**.
@@ -137,7 +137,7 @@ Your bot should now be **offline** in your server. Congratulations, that's as ex ## Create a MongoDB database -Modmail uses MongoDB to store its internal configurations and log histories. You must create a MongoDB database in order to use Modmail. +Modmail uses MongoDB to store its internal configurations and log histories. You must create a MongoDB database in order to use Modmail. We will be using [MongoDB Atlas](https://www.mongodb.com/atlas), which provides us with a free 512MB storage share—more than enough for Modmail. @@ -172,9 +172,9 @@ In the next step for "deploy a cloud database", choose the **Shared** option. An It's possible that you verified your email in a different browser session, or you manually signed in to MongoDB Atlas. -In this case, you can still follow the same steps below, but first click **Build a Database**: +In this case, you can still follow the same steps below, but first click **Build a Database**: -![Screenshot of homepage and click build a database.](../.gitbook/assets/Image22.png) +Screenshot of homepage and click build a database. @@ -190,7 +190,7 @@ In this case, you can still follow the same steps below, but first click **Build
-On the following **Security Quickstart** page, do the following: +On the following **Security Quickstart** page, do the following: 1. Authentication method: _Username and Password_ @@ -245,7 +245,7 @@ My MongoDB connection string: mongodb+srv://modmail:@cluster0.example. ``` {% endcode %} -Finally, you will need to combine the database password with the MongoDB connection string by **replacing** the `` (including the `<>`) with the database password. +Finally, you will need to combine the database password with the MongoDB connection string by **replacing** the `` (including the `<>`) with the database password. You also need to **remove** everything after `.mongodb.net` at the end of the MongoDB connection string. @@ -258,55 +258,85 @@ My MongoDB connection string: mongodb+srv://modmail:elAO7wF1r07pNG6u@cluster0.ex ``` {% endcode %} -You finished the MongoDB steps! At this point, your bot should still be **offline**. You can now proceed to the [next steps](./#next-steps) and start up your Modmail bot. +You finished the MongoDB steps! At this point, your bot should still be **offline**. You can now proceed to the next step which is to choose your hosting method. -## Next steps +## Preparing your Environmental Variables -Click on one of the links below to view further instructions for your preferred hosting method. +Once you have finished the previous steps, gather and save the variables listed below as they will be needed to run your bot in later steps: -### [Railway](railway.md) (free) +* `TOKEN` - The token to run your Modmail application under your Discord bot account +* `LOG_URL` **- \[Optional]** Logviewer URL that will be used to view threads in your web browser +* `GUILD_ID` - The ID of the main Discord server that your bot will operate in. +* `MODMAIL_GUILD_ID` - **\[Optional]** The ID of the Discord server that your bot will create ticket channels in. This is only needed if you want your ticket channels to be created in a separate server, for an example, Staff Server. +* `OWNERS` - The user ID of the Discord accounts you want to set as owner for the bot. Can consist of multiple users, separated by comma. +* `CONNECTION_URI` - The URI the bot will use to connect to your MongoDB instance. -A platform as a service (PaaS) that offers a generous free plan, which allows you to host Modmail for free without any downtime. A credit card is required for verification purposes.[ **Go to guide ►**](railway.md)**** +Your finished variables should look something like this: -### [Local Hosting](local-hosting-vps/) (free) +{% code title=".env" %} +```py +TOKEN=OTY3Nzy5MzU5NjAzMzU2NzE4.GtKp_5.JOTYRwGW-LB1He5widCu73vXtmi90KxsqkmoOg +LOG_URL=https://logs.mymodmailbot.com/ +GUILD_ID=1079074933008781362 +OWNERS=188363246695219201,231595246213922828 +MONGO_URI=mongodb+srv://username:password@cluster0-abcde.mongodb.net/ +``` +{% endcode %} + +## Hosting Modmail + +Your next step is to choose one of our supported hosting method that's available and preferable to you. -Do you have an old PC, a Raspberry Pi, or a Linux box that you're able to keep online 24/7? +Click on one of the links below to view further instructions for your preferred hosting method. Each method has their pros and cons, be sure to take them into consideration when choosing your hosting platform to run Modmail. -You can host Modmail on it for free (electricity fees may apply).[ **Go to guide ►**](local-hosting-vps/)**** +### [Railway](railway.md) (free/paid) + +A platform as a service (PaaS) that offers a generous free plan, which allows you to host Modmail for free without any downtime. A credit card is required for verification purposes. Their UI is very simple and easy for beginners to quickly deploy and run your Modmail bot on. You can learn more about their Free Tier plan and pricing by clicking [here](https://railway.app/pricing). + +### [Northflank](https://northflank.com/) (free/paid) + +A PaaS like Railway but with more advanced UI and more features. Does require credit card for verification but has a dedicated free tier that has no hourly limit. Learn more about their free tier and pricing by clicking [here](https://northflank.com/pricing). + +### [Local Hosting](local-hosting-vps/) (free) + +If you have an old PC, a Raspberry Pi, or a Linux box that you're able to keep online 24/7, you can also host Modmail with your own machine at home. Since Modmail doesn't require intensive resources to run, you can get by with a system having as low as 1GB of RAM. Setting it up can be quite advanced but you have complete control over your bot instance. Refer to our local hosting guide supporting a few popular OSes by clicking [here](./#local-hosting-free). ### [Modmail Patreon](https://www.patreon.com/kyber) (paid) -We offer paid hosting solution for your Modmail bot. Hosting Modmail with us costs $4-5 USD per month. +We offer paid hosting solution for your Modmail bot. Hosting Modmail with us costs $4-5 USD per month. -We will also fully manage your bot hosting for you, so you don't need to worry about upgrading or setting up your own host server. [ **Go to Patreon page ►**](https://www.patreon.com/kyber)**** +We will also fully manage your bot hosting for you, so you don't need to worry about upgrading or setting up your own host server. Refer to our [Patreon Hosting here](https://www.patreon.com/kyber). ### [Heroku](heroku.md) (paid) -Another popular PaaS that's used to be free. However, their recent pricing adjustments, it now costs $5-7 USD per month. +Another popular PaaS that's used to be free. However, their recent pricing adjustments, it now costs $5-7 USD per month to host Modmail. -If you are currently a higher-education student, you may be eligible for the first year free with their [student offer](https://www.heroku.com/github-students).[ **Go to guide ►**](heroku.md)**** +If you are currently a higher-education student, you may be eligible for the first year free with their [student offer](https://www.heroku.com/github-students). Refer to our Heroku installation guide by clicking [here](heroku.md). ### [Cloud Server / VPS](local-hosting-vps/) (paid) -Apart from [Patreon hosting](./#modmail-patreon-paid), hosting on a cloud server / VPS is the most reliable hosting method. Rent a virtual server from any reputable hosting provider for roughly $4-10 USD per month (price varies), and you'll be able to install Modmail onto the server. +Apart from [Patreon hosting](./#modmail-patreon-paid), hosting on a cloud server / VPS is the most reliable hosting method. Rent a virtual server from any reputable hosting provider of your choice for roughly $4-10 USD per month (price varies), and you'll be able to install Modmail onto the server. -This method is a lot more "involved" than other solutions. If you're not comfortable with configuring remote Linux environments, we recommend you to choose a different option. [ **Go to guide ►**](local-hosting-vps/)**** +This method is a lot more "involved" than other solutions. If you're not comfortable with configuring remote Linux environments, we recommend you to choose a different option. For this method, you will need to refer to our Local hosting installation guide [here](local-hosting-vps/) and choose your desired OS. -### [Replit](replit.md) (free/paid) +### [Replit](https://replit.com/\~) (free/paid) -> The Modmail team does not recommend this hosting method. +{% hint style="warning" %} +The Modmail team does not recommend this hosting method due to their highly unstable and heavily abused environment. That said, we still decided to list this option here as a method for users with no access to valid payment cards since most hosting platforms require them for verification.\ +\ +Please note that our Support Team will not be offering any official help or support if you choose this method to host Modmail. +{% endhint %} -An online code execution environment. You can host Modmail there for free using certain exploits. The legitimate method costs $7 USD per month. However, regardless if you pay or host for free, hosting on Replit are often unstable. [ **Go to guide ►**](replit.md)**** +An online code execution environment. You can host Modmail there for free using certain exploits. The legitimate method costs $7 USD per month. However, regardless if you pay or host for free, hosting on Replit are often unstable and thus not recommended. However, a community guide is still available by clicking [here](broken-reference). -### Not satisfied with these options? +## Community Guides + +{% hint style="warning" %} +Community guides are not verified by the Modmail team, so use them at your own risk. +{% endhint %} -Some of our community members have created their own [installation guides](community-guides.md) for Modmail. Feel free to check them out at: +If you're not satisfied with the options listed above, some of our community members have created their own installation guides for Modmail on various other hosting platforms. Keep in mind that Modmail support staff may not be able to assist you much with community-made guides. Feel free to check them out by clicking the link below. {% content-ref url="community-guides.md" %} [community-guides.md](community-guides.md) {% endcontent-ref %} - -{% hint style="warning" %} -Community guides are not verified by the Modmail team, so use them at your own risks. -{% endhint %} - diff --git a/installation/community-guides.md b/installation/community-guides.md index 6dd8c81..64ce8f4 100644 --- a/installation/community-guides.md +++ b/installation/community-guides.md @@ -8,4 +8,10 @@ description: Unofficial installation guides created by the community. Community guides are not verified by the Modmail team, so use them at your own risks. {% endhint %} -TODO +## [Replit Guide](https://gist.github.com/anondev-sudo/24978429b85b44348bcff5c0885afe82) by AnonDev + +An online code execution environment. You can host Modmail there for free using certain exploits. The legitimate method costs $7 USD per month. However, regardless if you pay or host for free, hosting on Replit are often unstable and thus not recommended. But for now, this is the only option for those without a payment method for hosting or verification. + +## [Northflank](https://blog.project-mei.xyz/2023/04/11/hosting-discord-modmail-on-northflank/) Guide by raidensakura + +Northflank is a Platform as a Service (PaaS) like Railway that offers abilities to run micro-services like bots, schedule jobs that run periodically and databases with a powerful UI, API and CLI. Their panel is a bit more advanced as compared to Railway but comes with the perk of more customization and features. You will need a valid payment method to verify your account, but will unlock a free tier project that's separated from paid resources. They will not charge your card if you go over resource usage as you have limited allocation per service. diff --git a/installation/local-hosting-vps/README.md b/installation/local-hosting-vps/README.md index 998044b..0ae116b 100644 --- a/installation/local-hosting-vps/README.md +++ b/installation/local-hosting-vps/README.md @@ -2,23 +2,31 @@ description: Hosting on the cloud or on your own computer. --- -# Local Hosting / VPS +# Local hosting / VPS -## Requirements +## General Requirements -* Somewhat recent hardware / software. -* Stable internet connection from hosting server. -* The hosting server remains online 24/7. -* You have completed the initial steps: [invited your bot](../#create-a-discord-bot) and [created a MongoDB database](../#create-a-mongodb-database). +* A supported hardware to comfortably run your chosen OS or a reliable VPS provider. +* Stable internet access and uptime for your machine or host. +* You have completed the initial steps in the [Installation](../) page. + +More OS-specific requirements will be listed on their specific installation page, you are free to choose a supported OS of your choice from the list below. ## Choose your Operating System -* [Windows](./windows.md) -* [MacOS](./macos.md) -* [Docker](./docker.md) -* [Ubuntu](./ubuntu.md) -* [Debian](./debian.md) -* [Fedora](./fedora.md) -* [AlmaLinux](./almalinux.md) -* [CentOS](./centos.md) -* [Raspberry Pi](./raspberry-pi.md) +* [Windows](windows.md) +* [MacOS](macos.md) +* [Docker](docker.md) +* [Ubuntu](ubuntu.md) +* [Debian](debian.md) +* [Fedora](fedora.md) +* [Alma Linux](almalinux.md) +* [CentOS](almalinux.md) +* [Raspberry Pi OS](debian.md) + +## Logviewer + +You can also self-host logviewer by following the guides below. + +* [Logviewer](logviewer.md) +* [Patreon Logviewer](patreon\_logviewer.md) diff --git a/installation/local-hosting-vps/almalinux.md b/installation/local-hosting-vps/almalinux.md index 0aff996..34301e1 100644 --- a/installation/local-hosting-vps/almalinux.md +++ b/installation/local-hosting-vps/almalinux.md @@ -1,11 +1,95 @@ --- -description: Deploy Modmail on a AlmaLinux server. +description: Deploy Modmail on RHEL / Alma Linux / CentOS server. --- -# AlmaLinux +# Alma Linux -TODO +{% hint style="warning" %} +For safety reasons, **DO NOT** install Modmail with a root user. A misbehaving or malicious plugin installed on your Modmail bot can easily access your entire system. If you are unsure how to create a new user on Linux, see [DigitalOcean’s tutorial: How To Create a New Sudo-enabled User](https://www.digitalocean.com/community/tutorials/how-to-create-a-new-sudo-enabled-user-on-ubuntu-20-04-quickstart). +{% endhint %} + +Alma Linux 8, 9 and CentOS Stream 8, 9 are based on Red Hat Enterprise Linux (RHEL) 8 and 9 respectively so you can essentially follow this guide if you're running any of the OS mentioned above. ## Prerequisites -## Updating +1. Root access (**`sudo`**). +2. Minimum 1GB of RAM +3. At least 2GB available disk space. +4. Supported releases: + * Alma Linux 9 + * Alma Linux 8 + * CentOS Stream 9 + * CentOS Stream 8 + * Red Hat Enterprise Linux (RHEL) 9 + * Red Hat Enterprise Linux (RHEL) 8 + +## Dependencies + +* Python 3.9 +* Tools: `git`, `nano` + +{% hint style="info" %} +All code blocks should be executed in bash and line by line unless specified otherwise. +{% endhint %} + +### RHEL 9 / Alma Linux 9 / CentOS Stream 9 + +RHEL 9 and its derivatives have all required packages available in official repositories. Install them with `dnf`: + +```bash +sudo dnf -y install python39 git @development nano +``` + +### RHEL 8 / Alma Linux 8 / CentOS Stream 8.4-8.x + +RHEL 8 and its derivatives have all required packages available in official repositories. Install them with `dnf`: + +```bash +sudo dnf -y update +sudo dnf -y group install development +sudo dnf -y install python39 python39-pip python39-devel nano git +``` + +## Installing Bot + +Clone and change directory into the Modmail folder with: + +```bash +git clone https://github.com/modmail-dev/modmail +cd modmail +``` + +Inside the Modmail folder, ensure `pip` is installed correctly and is defaulting to Python 3.9 with: + +```bash +python3.9 -m ensurepip --upgrade +``` + +And then, install `pipenv` and the bot dependencies with: + +```bash +python3.9 -m pip install pipenv +python3.9 -m pipenv install --python 3.9 +``` + +Create a file named `.env` with `nano` and paste all the environmental variables (secrets) needed to run the bot via right-clicking in the nano editor. Refer to the steps in the [parent Installation page](../#preparing-your-environmental-variables) to find where to obtain these. + +```bash +nano .env +``` + +
+ +After that, press `Ctrl+O` and `Enter` to save your changes. Exit the `nano` editor with `Ctrl+X`. + +{% hint style="info" %} +If using the `nano` editor is a bit of a learning curve, you can always FTP into your server using software like [WinSCP](https://winscp.net/eng/index.php) to edit the `.env` file manually with your preferred GUI-based editor like Notepad. +{% endhint %} + +After your `.env` file is ready, you can now go ahead and try running your bot with: + +```bash +python3.9 -m pipenv run bot +``` + +If no error shows up, it means your bot is now running correctly. You can stop the bot from running with `Ctrl+C` to continue using your terminal. diff --git a/installation/local-hosting-vps/centos.md b/installation/local-hosting-vps/centos.md deleted file mode 100644 index d0b4321..0000000 --- a/installation/local-hosting-vps/centos.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -description: Deploy Modmail on a CentOS server. ---- - -# CentOS - -TODO - -## Prerequisites - -## Updating diff --git a/installation/local-hosting-vps/debian.md b/installation/local-hosting-vps/debian.md index 874c4f9..9046ff8 100644 --- a/installation/local-hosting-vps/debian.md +++ b/installation/local-hosting-vps/debian.md @@ -1,11 +1,118 @@ --- -description: Deploy Modmail on a Debian server. +description: Deploy Modmail on Debian / Raspberry Pi OS. --- # Debian -TODO +{% hint style="warning" %} +For safety reasons, **DO NOT** install Modmail with a root user. A misbehaving or malicious plugin installed on your Modmail bot can easily access your entire system. If you are unsure how to create a new user on Linux, see [DigitalOcean’s tutorial: How To Create a New Sudo-enabled User](https://www.digitalocean.com/community/tutorials/how-to-create-a-new-sudo-enabled-user-on-ubuntu-20-04-quickstart). +{% endhint %} + +Raspberry Pi OS 11 Bullseye and Raspberry Pi OS 10 Buster are based on Debian 11 Bullseye and Debian 10 Buster respectively so you can essentially follow this guide if you're running any of the OS mentioned above. ## Prerequisites -## Updating +1. Root access (**`sudo`**). +2. Minimum 1GB of RAM +3. At least 2GB available disk space. +4. Supported releases: + * Debian 11 Bullseye + * Debian 10 Buster + * Raspberry Pi OS 11 Bullseye + * Raspberry Pi OS 10 Buster + +## Dependencies + +* Python 3.9 / 3.10 +* Tools: `git`, `wget`, `nano` +* Additional Modmail requirements: `libcairo2-dev`, `libffi-dev`, `g++` + +{% hint style="info" %} +All code blocks should be executed in bash and line by line unless specified otherwise. +{% endhint %} + +To install these dependencies, we will be using **`apt`**. + +### **Debian 11 Bullseye /** Raspberry Pi OS 11 Bullseye + +```bash +sudo apt update +sudo apt -y install python3 python3-dev python3-venv python3-pip libcairo2-dev libffi-dev g++ git wget nano +``` + +At the time of writing, this will install Python 3.9 from Debian's repository. + +### **Debian 10 Buster /** Raspberry Pi OS 10 Buster + +You will need to manually compile Python 3.10 from source. Compiling Python may take a while (est. 5-10 minutes). Make sure to run line 2-7 all at once. + +{% code lineNumbers="true" %} +```bash +sudo apt update && sudo apt upgrade -y # Update and upgrade all packages +sudo apt install -y software-properties-common \ + libcairo2-dev libffi-dev g++ \ + git wget nano \ + build-essential zlib1g-dev libncurses5-dev \ + libgdbm-dev libnss3-dev libssl-dev \ + libreadline-dev libffi-dev libsqlite3-dev libbz2-dev +wget https://www.python.org/ftp/python/3.10.9/Python-3.10.9.tgz +tar xzf Python-3.10.9.tgz +cd Python-3.10.9 +./configure --enable-optimizations +sudo make altinstall +``` +{% endcode %} + +After that, ensure `pip` is installed and updated for Python 3.10 with: + +``` +python3.10 -m ensurepip --upgrade +``` + +Then **log out and log back in** to continue the installation steps. + +## Installing Bot + +Clone and change directory into the Modmail folder with: + +```bash +git clone https://github.com/modmail-dev/modmail +cd modmail +``` + +Inside the Modmail folder, Install `pipenv` and the bot dependencies with: + +```bash +python3.9 -m pip install pipenv +python3.9 -m pipenv install --python 3.9 +``` + +{% hint style="info" %} +Replace `3.9` with `3.10` on the command above if you followed[ Debian 10 Buster](debian.md#debian-10-buster-raspberry-pi-os-10-buster) method previously. +{% endhint %} + +Create a file named `.env` with `nano` and paste all the environmental variables (secrets) needed to run the bot via right-clicking in the nano editor. Refer to the steps in the [parent Installation page](../#preparing-your-environmental-variables) to find where to obtain these. + +```bash +nano .env +``` + +
+ +After that, press `Ctrl+O` and `Enter` to save your changes. Exit the `nano` editor with `Ctrl+X`. + +{% hint style="info" %} +If using the `nano` editor is a bit of a learning curve, you can always FTP into your server using software like [WinSCP](https://winscp.net/eng/index.php) to edit the `.env` file manually with your preferred GUI-based editor like Notepad. +{% endhint %} + +After your `.env` file is ready, you can now go ahead and try running your bot with: + +```bash +python3.9 -m pipenv run bot +``` + +{% hint style="info" %} +Replace `3.9` with `3.10` on the command above if you followed[ Debian 10 Buster](debian.md#debian-10-buster-raspberry-pi-os-10-buster) method previously. +{% endhint %} + +If no error shows up, it means your bot is now running correctly. You can stop the bot from running with `Ctrl+C` to continue using your terminal. diff --git a/installation/local-hosting-vps/docker.md b/installation/local-hosting-vps/docker.md index ba2d7c2..68f65aa 100644 --- a/installation/local-hosting-vps/docker.md +++ b/installation/local-hosting-vps/docker.md @@ -4,24 +4,116 @@ description: Deploy Modmail on Docker. # Docker -TODO +{% hint style="info" %} +Docker is considered an advanced setup, it is recommended that you understand how Docker works before deciding to use this method. +{% endhint %} + +

A simple illustration explaining how Docker works

## Prerequisites -- Supported OS for Docker Engine -- Docker Engine -- Docker Compose +* Supported OS for Docker +* Docker Engine +* Docker Compose ## Installing Docker Engine -Depending on which operating system you are running, you should follow the specific [guides](https://docs.docker.com/engine/install/). +Docker has their own installation page for popular Linux-based distros, read them by visiting the link below: + +{% embed url="https://docs.docker.com/engine/install/" %} + +If you're on a desktop environment, refer to the "Desktop" section of their documentation as Docker Desktop also comes with nice GUI that you manage your deployments with. + +For VPS and servers, refer to the "Server" section as you will be needed to learn the CLI commands to run Modmail with Docker. + +After the installation process has finished, you can try running the commands below in your terminal to see if **Docker** and **Docker Compose** has been installed successfully: + +```docker +docker --version +docker compose version +``` + +{% hint style="info" %} +You may need to change your Docker Compose command to `docker-compose --version` depending on the version you have installed. +{% endhint %} + +## Running the official image for Modmail + +You can pull the latest official image from Modmail repository by using the following command: + +```docker +docker pull ghcr.io/modmail-dev/modmail:master +``` + +This will take some time depending on the speed of your network. It will also update the already existing image if you have previously pulled the same image before. + +After that, you can run the bot as a container with the following command: + +```docker +docker run -d --name modmail \ +--env-file /path/to/.env \ +--restart always ghcr.io/modmail-dev/modmail:master +``` + +Make sure to change `/path/to/.env` to the location of the `.env` file containing all the variables that you want the bot to start with. Refer to the steps in the [parent Installation page](../#preparing-your-environmental-variables) to find where to obtain these. + +After deploying, you can view the logs of your currently running Modmail container with the following command: + +```docker +docker logs modmail +``` + +You can stop your running Modmail container with: + +``` +docker stop modmail +``` + +Stopping the container does not remove the container files, so you can start it back up with: + +``` +docker start modmail +``` + +If you want to stop and remove the container completely, you can do so with: + +``` +docker rm -f modmail +``` + +The `-f` will forcefully remove and delete the container even if it's currently running. You can omit the flag if the container is already stopped. + +## Building the image locally + +You can also build the image locally on your machine if the repository files are already in your machine. In your Modmail project folder, simply run the build command below: + +``` +docker build . -t myname/modmail:latest +``` + +The `.` in the command will use the `Dockerfile` in the Modmail repository as the build steps. The `-t` flag will specify the image tag so it's easier for us to differentiate between multiple images in our system. Verify if the image is successfully built with the following command: + +``` +docker images +``` + +You should be able to see the tag we just used in the list: + +
+ +Now you can use the `docker run` command to run your bot using your locally-built image: + +```docker +docker run -d --name modmail \ +--env-file /path/to/.env \ +--restart always myname/modmail:latest +``` + +## Updating on Docker + +Auto-update is disabled when running Docker as Docker container state is not persistent across restarts. To update your bot, you will need to update the base image by running the `docker pull` command in the previous step: [Running the official image for Modmail](docker.md#running-the-official-image-for-modmail) if your image is based from the official repository. After that, you must recreate your container using the `docker rm` and `docker run` command again. -* [CentOS](https://docs.docker.com/engine/install/centos/) -* [Debian](https://docs.docker.com/engine/install/debian/) -* [Fedora](https://docs.docker.com/engine/install/fedora/) -* [RedHat](https://docs.docker.com/engine/install/rhel/) -* [Ubuntu](https://docs.docker.com/engine/install/ubuntu/) +If your image is created locally, simply replace the `docker pull` command with `git pull` and rebuilding your image again. -When installing, make sure you install `docker-compose-plugin` as this plugin will power the bot and additional services needed. +To automate this process on Docker, you can look into running [Watchtower](https://containrrr.dev/watchtower/) which will auto-update your containers whenever a new image is pushed on the remote repository. Please refer to their documentation for guide and configuration. -## Updating diff --git a/installation/local-hosting-vps/fedora.md b/installation/local-hosting-vps/fedora.md index 8e2d2bc..a5a629b 100644 --- a/installation/local-hosting-vps/fedora.md +++ b/installation/local-hosting-vps/fedora.md @@ -4,8 +4,77 @@ description: Deploy Modmail on a Fedora server. # Fedora -TODO +{% hint style="warning" %} +For safety reasons, **DO NOT** install Modmail with a root user. A misbehaving or malicious plugin installed on your Modmail bot can easily access your entire system. If you are unsure how to create a new user on Linux, see [DigitalOcean’s tutorial: How To Create a New Sudo-enabled User](https://www.digitalocean.com/community/tutorials/how-to-create-a-new-sudo-enabled-user-on-ubuntu-20-04-quickstart). +{% endhint %} ## Prerequisites -## Updating +1. Root access (**`sudo`**). +2. Minimum 1GB of RAM +3. At least 2GB available disk space. +4. Supported releases: + * Fedora 38 + * Fedora 37 + * Fedora 36 + * Fedora 35 + +## Dependencies + +* Python 3.10 +* Tools: `git`, `wget`, `nano` +* Additional Modmail requirements: `g++` + +{% hint style="info" %} +All code blocks should be executed in bash and line by line unless specified otherwise. +{% endhint %} + +Fedora Linux 35 and above has all required packages available in official repositories. Install them with `dnf`. + +```bash +sudo dnf -y install python310 git nano g++ gtk3 +``` + +And then, make sure `pip` is installed for Python 3.10 with: + +```bash +python3.10 -m ensurepip --upgrade +``` + +## Installing Bot + +Clone and change directory into the Modmail folder with: + +```bash +git clone https://github.com/modmail-dev/modmail +cd modmail +``` + +And then, install `pipenv` and the bot dependencies with: + +
python3.10 -m pip install pipenv
+python3.10 -m pipenv install --python 3.10
+
+ +Create a file named `.env` with `nano` and paste all the environmental variables (secrets) needed to run the bot via right-clicking in the nano editor. Refer to the steps in the [parent Installation page](../#preparing-your-environmental-variables) to find where to obtain these. + +```bash +nano .env +``` + +
+ +After that, press `Ctrl+O` and `Enter` to save your changes. Exit the `nano` editor with `Ctrl+X`. + +{% hint style="info" %} +If using the `nano` editor is a bit of a learning curve, you can always FTP into your server using software like [WinSCP](https://winscp.net/eng/index.php) to edit the `.env` file manually with your preferred GUI-based editor like Notepad. +{% endhint %} + +After your `.env` file is ready, you can now go ahead and try running your bot with: + +```bash +python3.10 -m pipenv run bot +``` + +If no error shows up, it means your bot is now running correctly. You can stop the bot from running with `Ctrl+C` to continue using your terminal. + diff --git a/installation/local-hosting-vps/logviewer.md b/installation/local-hosting-vps/logviewer.md new file mode 100644 index 0000000..292d6af --- /dev/null +++ b/installation/local-hosting-vps/logviewer.md @@ -0,0 +1,74 @@ +--- +description: Hosting the logviewer on the cloud or on your own computer. +--- + +# Logviewer + +## Prerequisites + +This logviewer hosting tutorial is written assuming you have already set up your bot and are running Ubuntu 20.04-22.04. + +## Downloading the files + +* You must have git installed on your system. If you do not, run `sudo apt install git` to install it. + +You can download the logviewer files by running the following command: + +```bash +git clone https://github.com/modmail-dev/logviewer logviewer +``` +
+Once done, you can use `cd logviewer` to enter the directory. + +## Installing the dependencies + +First, install pipenv by running the following command: + +* Pipenv must be installed. Since this is also used for the bot, you can skip this step if you have already installed it. + +```bash +python -m pip install pipenv +``` + +Installing the dependencies is done by running the following command: + +```bash +pipenv install +``` +
+ +## Configuring the .env + +To configure the `.env` file, you can use the following command: + +```bash +nano .env.example +``` +This will open the example `.env` file in nano. You can then edit the file with your info. +You will need to enter the same mongo URI as your bot uses. The rest of the configs can be left to the default values, unless you have a specific reason to change them. + +Then save the file and exit nano by pressing `ctrl + x`, then `y`, change the name from `.env.example` to `.env` and then `enter`. + +## Running the logviewer + +Now you can start the logviewer with the following command + +```bash +sudo pipenv run logviewer +``` + +## (Optional) Keep logviewer running in the background with pm2 + +Pm2 can keep your logviewer automatically online in the background even if you close your terminal. To install pm2, run the following command: + +```bash +sudo apt install npm -y && sudo npm i pm2 -g +``` + +Once installed, you can start the logviewer with pm2 by running the following command: + +```bash +sudo pm2 start logviewer.sh --name "logviewer" && sudo pm2 save +``` + +More info on how to use pm2 can be found [on pm2's website](https://pm2.keymetrics.io/docs/usage/quick-start/). diff --git a/installation/local-hosting-vps/patreon_logviewer.md b/installation/local-hosting-vps/patreon_logviewer.md new file mode 100644 index 0000000..918c407 --- /dev/null +++ b/installation/local-hosting-vps/patreon_logviewer.md @@ -0,0 +1,106 @@ +--- +description: Hosting the patreon logviewer on the cloud or on your own computer. +--- + +# Patreon logviewer + +This logviewer hosting tutorial is written assuming you have already set up your bot and are running Ubuntu 20.04-22.04. + +## Setting up OAuth2 + +To set up OAuth2, you need to set a few settings in your Discord Developer Portal. First, head to the [Discord Developer Portal](https://discord.com/developers/applications) and select your modmail bot application. Then go to "OAuth2" and "General" +
+ +First, copy the Client ID and Client Secret. You will need these later when filling in the `.env`. +Then, set a redirect URL to `https://yourlogviewer.com/callback`, with the url being changed to the url of your logviewer. +Finally, click save. +
+ +## Downloading the files + +* You must have git installed on your system. If you do not, run `sudo apt install git` to install it. + +Due to the logviewer premium repo being private, you will first need to set up a personal access token to clone the repo. To do this, follow the steps below. + +* Open github in your browser +* When logged in, click your name in the top right and go to 'settings' +* On the left, click 'Developer settings' +* On the left, click 'Personal access tokens' and then 'Tokens (classic)' +* Click 'Generate new token' +* Give the token a name and select the 'repo' scope +* Copy the token and save it somewhere safe + +
+
+
+
+
+ +You can download the logviewer files by running the following command: + +```bash +git clone https://github.com/modmail-dev/logviewer-premium logviewer +``` + +You will be prompted for your username and password. Enter your github username and the personal access token you just created. +
+Once done, you can use `cd logviewer` to enter the directory. + +## Installing the dependencies + +First, install pipenv by running the following command: + +* Pipenv must be installed. Since this is also used for the bot, you can skip this step if you have already installed it. + +```bash +python -m pip install pipenv +``` + +Installing the dependencies is done by running the following command: + +```bash +pipenv install +``` +
+ +## Configuring the .env + +To configure the `.env` file, you can use the following command: + +```bash +nano .env.example +``` +This will open the example `.env` file in nano. You can then edit the file with your info. Besides the normal logviewer config, you will also need to add your bot's token and the client ID and secret you copied earlier. + +You will need to enter the same mongo URI as your bot uses. The rest of the configs can be left to the default values, unless you have a specific reason to change them. + +Then save the file and exit nano by pressing `ctrl + x`, then `y`, change the name from `.env.example` to `.env` and then `enter`. + +## Running the logviewer + +Now you can start the logviewer with the following command + +```bash +sudo pipenv run logviewer +``` + +## Whitelisting users + +To allow people to view the logviewer, you will have to whitelist them. To do this, you can use the following command in discord where your modmail bot is: +`?oauth whitelist roleID` or `?oauth whitelist userID`. + +## (Optional) Keep logviewer running in the background with pm2 + +Pm2 can keep your logviewer automatically online in the background even if you close your terminal. To install pm2, run the following command: + +```bash +sudo apt install npm -y && sudo npm i pm2 -g +``` + +Once installed, you can start the logviewer with pm2 by running the following command: + +```bash +sudo pm2 start logviewer.sh --name "logviewer" && sudo pm2 save +``` + +More info on how to use pm2 can be found [on pm2's website](https://pm2.keymetrics.io/docs/usage/quick-start/). diff --git a/installation/local-hosting-vps/raspberry-pi.md b/installation/local-hosting-vps/raspberry-pi.md deleted file mode 100644 index d89f975..0000000 --- a/installation/local-hosting-vps/raspberry-pi.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -description: Deploy Modmail on a Raspberry Pi. ---- - -# Raspberry Pi - -TODO - -## Prerequisites - -## Updating diff --git a/installation/local-hosting-vps/ubuntu.md b/installation/local-hosting-vps/ubuntu.md index 72606a6..5f73513 100644 --- a/installation/local-hosting-vps/ubuntu.md +++ b/installation/local-hosting-vps/ubuntu.md @@ -4,52 +4,68 @@ description: Deploy Modmail on an Ubuntu server. # Ubuntu +{% hint style="warning" %} +For safety reasons, **DO NOT** install Modmail with a root user. A misbehaving or malicious plugin installed on your Modmail bot can easily access your entire system. If you are unsure how to create a new user on Linux, see [DigitalOcean’s tutorial: How To Create a New Sudo-enabled User](https://www.digitalocean.com/community/tutorials/how-to-create-a-new-sudo-enabled-user-on-ubuntu-20-04-quickstart). +{% endhint %} + ## Prerequisites -* Root access (**`sudo`**). -* Minimum 1GB of RAM, 2GB recommended. -* 2GB available disk space. -* Supported releases: Ubuntu 18.04 LTS, Ubuntu 20.04 LTS, Ubuntu 22.04 LTS. +1. Root access (**`sudo`**). +2. Minimum 1GB of RAM +3. At least 2GB available disk space. +4. Supported releases: + * Ubuntu 18.04 LTS (Bionic Beaver) + * Ubuntu 20.04 LTS (Focal Fossa) + * Ubuntu 22.04 LTS (Jammy Jellyfish) ## Dependencies We will be using the following dependencies: * Python 3.10 -* NGINX web server -* Tools: `git`, `wget`, `software-properties-common` +* Tools: `git`, `wget`, `nano`, `software-properties-common` * Additional Modmail requirements: `libcairo2-dev`, `libffi-dev`, `g++` -To install these dependencies, we will be using the **`apt`**. - {% hint style="info" %} -All code blocks should be executed in bash unless specified otherwise. +All code blocks should be executed in bash and line by line unless specified otherwise. {% endhint %} -{% code title="bash" %} +To install these dependencies, we will be using **`apt`**. + +We recommend adding the `deadsnakes` ppa to install Python 3.10: + ```bash -sudo apt update && sudo apt upgrade -y # Update and upgrade all packages -sudo apt install -y software-properties-common -sudo add-apt-repository ppa:deadsnakes/ppa # Official Python PPA sudo apt update -sudo apt install -y python3.10 python3.10-dev python3.10-venv \ +sudo apt -y install software-properties-common +sudo add-apt-repository -y ppa:deadsnakes/ppa +``` + +Now install the pre-requirements with `apt`, you can copy and run these 3 lines at once: + +```bash +sudo apt -y install python3.10 python3.10-dev python3.10-venv python3-pip \ libcairo2-dev libffi-dev g++ \ - git wget nginx + git nano +``` + +After that, install `pipenv` with: + +```bash +python3.10 -m pip install pipenv ``` -{% endcode %}
Failed to install Python 3.10? -You can manually compile Python instead of adding using the Deadsnakes PPA. Compiling Python may take a while (est. 5-10 minutes). +You can manually compile Python instead of adding using the Deadsnakes PPA. Compiling Python may take a while (est. 5-10 minutes). Copy and run line 2-7 all at once. -{% code title="bash" %} +{% code lineNumbers="true" %} ```bash sudo apt update && sudo apt upgrade -y # Update and upgrade all packages sudo apt install -y software-properties-common \ libcairo2-dev libffi-dev g++ \ - git wget nginx \ + git wget nano \ build-essential zlib1g-dev libncurses5-dev \ libgdbm-dev libnss3-dev libssl-dev \ libreadline-dev libffi-dev libsqlite3-dev libbz2-dev @@ -63,8 +79,38 @@ make altinstall
+## Installing Bot +Clone and change directory into the Modmail folder with: +```bash +git clone https://github.com/modmail-dev/modmail +cd modmail +``` + +Inside the Modmail folder, Install `pipenv` and its Python packages with: + +
python3.10 -m pipenv install --python 3.10
+
+ +Create a file named `.env` with `nano` and paste all the environmental variables (secrets) needed to run the bot via right-clicking in the nano editor. Refer to the steps in the [parent Installation page](../#preparing-your-environmental-variables) to find where to obtain these. + +```bash +nano .env +``` + +
+After that, press `Ctrl+O` and `Enter` to save your changes. Exit the `nano` editor with `Ctrl+X`. + +{% hint style="info" %} +If using the `nano` editor is a bit of a learning curve, you can always FTP into your server using software like [WinSCP](https://winscp.net/eng/index.php) to edit the `.env` file manually with your preferred GUI-based editor like Notepad. +{% endhint %} + +After your `.env` file is ready, you can now go ahead and try running your bot with: + +```bash +python3.10 -m pipenv run bot +``` -## Updating +If no error shows up, it means your bot is now running correctly. You can stop the bot from running with `Ctrl+C` to continue using your terminal. diff --git a/installation/local-hosting-vps/windows.md b/installation/local-hosting-vps/windows.md index 98d4c5f..aa19ea1 100644 --- a/installation/local-hosting-vps/windows.md +++ b/installation/local-hosting-vps/windows.md @@ -6,87 +6,77 @@ description: Deploy Modmail on a Windows machine. ## Prerequisites -* Somewhat recent hardware / software. -* Stable internet connection from hosting server. -* The hosting server remains online 24/7. -* You have completed the initial steps: [invited your bot](../#create-a-discord-bot) and [created a MongoDB database](../#create-a-mongodb-database). -* Windows 10 or 11 (any varient) +1. Minimum 2GB of RAM\* +2. At least 2GB available disk space. +3. Supported Windows version: + * Windows 10 + * Windows 11 -## Filling Enviornment Variables -Once you have finished the prerequsite steps, gather your: -* BotToken -* Logviewer URL (or what you plan on using if you haven't set it up yet.) -* Primary Guild (Server) ID -* Inbox Guild (Server) ID (if applicable) -* Bot Owner's ID (usually just your ID) -* Completed MongoURI +{% hint style="info" %} +Note that while it is possible to run Modmail with even less memory, Windows 10 itself recommend at least 2GB (4GB for Windows 11). This guide assumes the lowest threshold to comfortably run Modmail without possibly running into any resource bottleneck. +{% endhint %} -Once you have done so, open the file `.env.example` included in your download in your preferred raw text editor of choice (Usually Notepad or Notepad++, however others exist. *Do not use Word, WordPad, or similar*) +{% hint style="warning" %} +It is not recommended to run Modmail with previous versions of Windows such as Windows 7 or Windows 8.1 as they no longer receive important security updates, making your hosted applications significantly more prone to security vulnerabilities. +{% endhint %} +## Dependencies -Begin to fill in the information required: -``TOKEN=`` your bot’s token. +We will be using the following dependencies: +* Chocolatey +* Python 3.10 +* Additional Modmail requirements: [GTK for Windows](https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer/) -``LOG_URL=`` the URL of your log viewer. +To install these dependencies, we will be using Powershell. +Search “powershell” in the Windows start menu, right-click on it and then click “Run as administrator”. -``GUILD_ID=`` the ID of the server your bot operates in. +Then run each of the following commands: - -``OWNERS=`` your user ID (ie. OWNERS=9821302031291298, or if multiple owners, OWNERS=9821302031291298,9781239213813229,924822913921391). - - -``MONGO_URI=`` your Mongo connection URI from the MongoDB setup. - - -Together, they should resemble something similar to the original ``.env.example`` file. - - -Save the file as ``.env`` when done. - -It should look something like this: -{% code title=".env" %} -```py -TOKEN=yourbottokengoeshere -LOG_URL=https://example.logs.vodka/ -GUILD_ID=1079074933008781362 -OWNERS=188363246695219201,231595246213922828 -MONGO_URI=mongodb+srv://username:password@cluster0-abcde.mongodb.net/ +```powershell +Set-ExecutionPolicy Bypass -Scope Process -Force +[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 +iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) +choco upgrade git --params "/GitOnlyOnPath /WindowsTerminal" -y +choco upgrade python310 -y ``` -{% endcode %} - -## Installing Python -Download Python and set up Python from official Python download page: https://www.python.org/downloads/. The pre-installed Python on your local machine is usually out of date, you need the version of Python 3.09 for Modmail. +After that, ensure `pip` and `pipenv` are installed and updated for Python 3.10 with: -> The version of Python required may change overtime. Use the version that is recommended in this guide, and then reach out to us in the Support Server if that gives you problems. We will attempt to keep these guides as up to date as possible, however, this is the one place where a potiental version mismatch could occur. +```powershell +py -3.10 -m ensurepip --upgrade +py -3.10 -m pip install pipenv +``` -## Running Modmail +After the above installation has finished, download and install the **GTK runtime for Windows** by [clicking here](https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer/releases/latest). -Open Command Prompt, or "cmd". You can do this in one of two ways. +## Installing Bot -1. Press the Windows Key, then type "cmd" and press enter. -2. Hold down the Windows Key + R, a Run Dialog will appear, type in "cmd" and press enter. +In any folder location of your choice, `Shift+Right Click` and click on `Open PowerShell window here`. -### Navigate to where you stored Modmail +In your PowerShell window, run these commands to clone the official Modmail repository locally and `cd` into the folder: -Find the path of where you located your modmail in File Explorer, right click the folder name `modmail` or `modmail-master` and click "Copy Path". +```powershell +git clone https://github.com/modmail-dev/modmail +cd modmail +``` -Then go back to your Command Prompt, and type ``cd `` then right click and press paste. This will paste in the path of the folder you just found in File Explorer. Press enter to change to that directory. +Install project dependencies inside Modmail's pipenv with: -### Install the requirements +```powershell +py -3.10 -m pipenv install +``` -Run this command: -```py -3.9 -m pip install pipenv && py -3.9 -m pipenv install``` +Create a new file in the modmail folder named `.env` and paste in your environmental variables needed to run Modmail. Refer to the steps in the [parent Installation page](../#preparing-your-environmental-variables) to find where to obtain these. -This will install the pipenv package, and then use it to install the most up-to-date list of dependencies from our dependency list. +
-### Start your Modmail +Lastly, in your PowerShell window simply enter the command below to run your Modmail bot: -To start the Modmail bot itself, run this command: -```py -3.9 -m pipenv run python bot.py``` +```powershell +py -3.10 -m pipenv run bot +``` -Your Modmail should now be working properly. If you are still having issues, let us know in our [support server](https://discord.gg/zmdYe3ZVHG). +If no error shows up, it means that your Modmail is now running correctly. -## Updating diff --git a/installation/railway.md b/installation/railway.md index b287180..df5543c 100644 --- a/installation/railway.md +++ b/installation/railway.md @@ -6,7 +6,7 @@ description: Deploy Modmail on Railway PaaS. ## What is Railway? -Railway is a deployment platform where you can provision infrastructure, develop with that infrastructure locally, and then deploy to the cloud. +Railway is a deployment platform where you can provision infrastructure, develop with that infrastructure locally, and then deploy to the cloud. ## Requirements @@ -27,7 +27,7 @@ To keep your bot running 24/7, you'll need to sign up for their "Developer" plan You will need to fork our repositories to deploy onto Railway. -Make sure you're logged in to [GitHub](https://github.com/). You will need to fork **two** repositories. +Make sure you're logged in to [GitHub](https://github.com/). You will need to fork **two** repositories. First we fork the Modmail repository. Head over to [https://github.com/modmail-dev/modmail/fork](https://github.com/modmail-dev/modmail/fork), leave all the settings as default, and click **Create fork**. @@ -37,7 +37,7 @@ Next do the same for the Logviewer repository by heading over to [https://github
Screenshot of creating a Logviewer fork.

Create a GitHub fork for the Logviewer Repository.

-Next, to keep your Modmail and Logviewer up to date, you will need to install the [Pull app](https://github.com/apps/pull). Simply head over to [https://github.com/apps/pull](https://github.com/apps/pull), click **Install**, choose **Only select repositories**, then select **both** the Modmail and Logviewer repositories that you forked in the previous step. +Next, to keep your Modmail and Logviewer up to date, you will need to install the [Pull app](https://github.com/apps/pull). Simply head over to [https://github.com/apps/pull](https://github.com/apps/pull), click **Install**, choose **Only select repositories**, then select **both** the Modmail and Logviewer repositories that you forked in the previous step.
@@ -69,9 +69,7 @@ If your GitHub account is new or not reputable, you may be asked to verify your This unfortunately means that you will have to provide a credit card for verification. Click **Verify Account**, read and accept Railway's **Terms of Service**, then enter your credit card details. You may be temporary charged $1 USD to confirm the legitimacy of the card. -![Screenshot of clicking verify account.](../.gitbook/assets/RW6.png)![Screenshot of clicking terms of service.](../.gitbook/assets/RW7.png)![Screenshot of clicking I agree with terms of service.](../.gitbook/assets/RW7B.png)![Screenshot of entering your credit card details.](../.gitbook/assets/RW8.png) - - +Screenshot of clicking verify account.Screenshot of clicking terms of service.Screenshot of clicking I agree with terms of service.Screenshot of entering your credit card details. @@ -103,7 +101,7 @@ From the [**New Project**](https://railway.app/new) page, create the project by
-Click **New Variable**, set left to be **`CONNECTION_URI`**, then on the right, paste your revised MongoDB connection string from your Notepad (if this is new to you, [go back and read the initial steps](./)). +Click **New Variable**, set left to be **`CONNECTION_URI`**, then on the right, paste your revised MongoDB connection string from your Notepad (if this is new to you, [go back and read the initial steps](./)). Don't add any other variables, nor use the suggested variables section. You should see a new variable named **`CONNECTION_URI`** added under variables once you're done. @@ -125,11 +123,11 @@ Next, go to the **Deployments** tab, look at the latest deployment, is it succes
-
Screenshot of the deployments tab, and clicking the URL.

Navigate to the Deployments tab, save and open this URL.

+
Screenshot of the deployments tab, and clicking the URL.

Navigate to the Deployments tab, save and open this URL.

-
Screenshot of the Logviewer homepage.

This URL should show the Logviewer homepage.

+
Screenshot of the Logviewer homepage.

This URL should show the Logviewer homepage.

@@ -153,22 +151,27 @@ Click **New Variable.** We will be adding 5 variables in total, so repeat this s | -------------------- | ----------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | | **`CONNECTION_URI`** | The MongoDB Connection string from your Notepad. |
mongodb+srv://modmail:elAO7wF1r07pNG6u@cluster0.example.mongodb.net
 
| +| | | | | **`TOKEN`** | The Discord bot token from your Notepad. |
MTA3Djv3IAxNjk1NDgdKD231.G1AoUjD.5z629aKP34JKHn4v1EsdNUwdDO3MvBR9ifVES4
 
| +| | | | | **`LOG_URL`** | The Logviewer URL from your Notepad. Remember to add `https://` in front! |
https://web-production-1234.up.railway.app
 
| +| | | | | **`OWNERS`** | Your Discord ID. If you have multiple owners, separate your IDs with a comma. |
718827787302791100
 
| +| | | | | **`GUILD_ID`** | The ID of the Discord server for your Modmail bot. |
109483701365508619
 
| +| | | |
Do you have a separate staff server? -If you manage a large server where you have a separate server for communication among your moderation team, Modmail supports directing threads into the staff server instead of your main (public) server. +If you manage a large server where you have a separate server for communication among your moderation team, Modmail supports directing threads into the staff server instead of your main (public) server. -Simply add an additional variable named **`MODMAIL_GUILD_ID`** and set the value to your staff server's ID. +Simply add an additional variable named **`MODMAIL_GUILD_ID`** and set the value to your staff server's ID. Note: the **`GUILD_ID`** should always be your main server's ID (not staff server's). @@ -204,7 +207,7 @@ You have 10 days to test Modmail without upgrading to the "Developer" plan. As m #### Usage-based subscription -Head over to the **** [**Billing Details**](https://railway.app/account/billing) page, click the **Unlock** button to unlock Developer plan. Then input your credit card details and hit **Subscribe to Developer Plan**. +Head over to the \*\*\*\* [**Billing Details**](https://railway.app/account/billing) page, click the **Unlock** button to unlock Developer plan. Then input your credit card details and hit **Subscribe to Developer Plan**. {% hint style="warning" %} Subscribing to the Developer plan under _usage based subscription_ **may incur you unexpected charges**. This because Railway does not provide any safe-guards or monthly spending limits. Average Modmail and Logviewer usage should be well below the free threshold. However, if you run resource-intensive code via plugins or due to other means, you credit card may be billed. @@ -258,9 +261,9 @@ There you go! Your bot should now be able to run 24/7 without interruptions. Hea How do I cancel my Developer plan subscription? -If you're subscribed under the [usage-based subscription](railway.md#usage-based-subscription) model, you can cancel your subscription by heading to the **** [**Billing Details**](https://railway.app/account/billing) page, click **Manage Subscription**, then click **Cancel plan**. +If you're subscribed under the [usage-based subscription](railway.md#usage-based-subscription) model, you can cancel your subscription by heading to the \*\*\*\* [**Billing Details**](https://railway.app/account/billing) page, click **Manage Subscription**, then click **Cancel plan**. -![Screenshot of clicking manage subscription.](../.gitbook/assets/RW25.png)![Screenshot of clicking cancel plan.](../.gitbook/assets/RW26.png) +Screenshot of clicking manage subscription.Screenshot of clicking cancel plan.
@@ -281,6 +284,3 @@ You can disable auto-updates by heading to the settings page for **both** your M Now that you've successfully set up Modmail, visit the [Getting Started](../getting-started.md) page to find information on using Modmail. You can also join our [**Discord Server**](https://discord.gg/cnUpwrnpYb) to interact with our community or get support for Modmail. - - - diff --git a/installation/replit.md b/installation/replit.md deleted file mode 100644 index dabfbb9..0000000 --- a/installation/replit.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -description: Deploy Modmail on Replit. (Not recommended) ---- - -# Replit - -{% hint style="danger" %} -This hosting method is not recommended by the Modmail team. -{% endhint %} - -## What is Replit? - -Replit is a platform for creating and sharing software. You can write your code and host it all in the same place. - -Replit often is unstable for hosting Modmail bots. Your bot may shutdown without any notice. - -## Requirements - -* An email account. -* A [GitHub](https://github.com/signup) account. -* You have completed the initial steps: [invited your bot](./#create-a-discord-bot) and [created a MongoDB database](./#create-a-mongodb-database). - -## Costs - -Hosting Modmail on Replit is free. However, this requires using an exploit. If you prefer to use Replit using their officially supported method, you will need to purchase their "Hacker" plan, which costs $7 USD per month. - -## Updating - - - diff --git a/setting-up-auto-restart.md b/setting-up-auto-restart.md new file mode 100644 index 0000000..287c1b7 --- /dev/null +++ b/setting-up-auto-restart.md @@ -0,0 +1,206 @@ +# Setting up auto-restart + +## Using PM2 on Linux + +PM2 is a process manager originally intended for Node.js but can also be used with Python applications, such as our Modmail bot and Logviewer. To use `pm2`, we will need to install Node Package Manager (`npm`). + +#### Installing `pm2` Using `apt` (Ubuntu, Debian, etc): + +```bash +sudo apt install npm -y && sudo npm i pm2 -g +``` + +#### Installing `pm2` using `dnf` (Fedora, Alma Linux, etc): + +```bash +sudo dnf -y install npm && sudo npm i pm2 -g +``` + +Then, in the Modmail folder, start the Modmail process in the background with: + +``` +pm2 start modmail.sh --name "modmail" +``` + +You can see the logs of your Modmail process with: + +``` +pm2 logs modmail +``` + +And then, to make sure that `pm2` stays active and persistent between machine restarts, run the following commands: + +```bash +pm2 save && pm2 startup +``` + +Here's some of the other PM2 commands for future reference: + +```bash +pm2 restart modmail +pm2 reload modmail +pm2 stop modmail +pm2 delete modmail +pm2 list +``` + +## Using systemd on Linux + +`systemd` is a built-in service manager for most Linux systems. It's primary used to manage background applications and services and to make applications auto-restart on crash and run on system startup. + +We will be using `systemd` for Modmail by making a service file for our bot. + +In order to create the service file, you will first need to know three things, your Linux `username`, your Modmail folder location as `modmail_path` and your Pipenv location as `pipenv_path`. + +First, your Linux `username` can be fetched with the following command: + +```bash +whoami +``` + +You can get your `pipenv_path` with: + +``` +whereis pipenv +``` + +Now, using `nano`, create a service file for systemd with: + +```bash +sudo nano /etc/systemd/system/modmail.service +``` + +and paste in the contents below, replacing `username`, `modmail_path` and `pipenv_path` with yours respectively. `Ctrl+O` and `Enter` to save. `Ctrl+X` to exit the nano editor. + +{% code title="modmail.service" %} +```bash +[Unit] +Description=Modmail bot +After=network.target + +[Service] +User=username # replace this +Group=username # replace this +Restart=always +RestartSec=10 +Type=simple +WorkingDirectory=modmail_path # replace this +ExecStart=pipenv_path run python bot.py # replace pipenv_path only + +[Install] +WantedBy=multi-user.target +``` +{% endcode %} + +Now, start your Modmail bot with: + +```bash +sudo systemctl start modmail +``` + +If everything goes correctly, you should see your bot online. You can also view the logs of your systemd process with: + +```bash +sudo journalctl -eu modmail +``` + +With that said, go ahead and enable your Modmail service to auto-restart after crash and reboot with: + +```bash +sudo systemctl enable modmail +``` + +If in the future you need to stop and disable your Modmail service, you can do so with: + +```bash +sudo systemctl stop modmail +sudo systemctl disable modmail +``` + +## Using PM2 on Windows + +Todo: [https://github.com/jessety/pm2-installer](https://github.com/jessety/pm2-installer) + +## Using NSSM on Windows + +To have the bot auto-restart on crash or system reboot, we will be using `nssm` by making a service for our bot application. + +First, find the Python path of your Modmail pipenv by running `pipenv shell` and `which python` in your Modmail folder. Copy the path that appears in your terminal and paste it in the first line of our next step. + +
+ +Second, create a file named `modmail.bat` in your modmail directory with the following contents, replacing `python_path` with the one you copied previously and `python.exe` with `activate.bat`: + +```batch +call python_path +call python bot.py +``` + +The finished file should look something like this: + +{% code title="modmail.bat" %} +```batch +call C:\Users\Raiden\.virtualenvs\modmail-oXWHQUly\Scripts\activate.bat +call python bot.py +``` +{% endcode %} + +Third, download `nssm` by [clicking here](http://nssm.cc/download) and downloading the file under "Latest Release". + +The download will be a `.zip` file so you'll need to extract it first using your file archiver program (such as WinRAR or 7-zip). After that, find `nssm.exe` in the folder corresponding to your OS bit version (these days it should be win64) and copy it's file path: + +
+ +As `nssm` itself is only a command-line program, we'll need to use our trusty Terminal to use the application to create our service. So, search up "Powershell" in your start menu, right-click it and click "Run as Administrator". + +Change directory (CD) into the folder path that you copied earlier, the command should look like something like this: + +```powershell +cd "C:\Users\Raiden\Downloads\nssm-2.24\win64" +``` + +{% hint style="info" %} +Wrapping "your folder\directory" on Windows in double quotes is necessary to make sure spaces in our file path is parsed correctly. +{% endhint %} + +And then, proceed to create a new service for Modmail using `nssm` with: + +```powershell +.\nssm install "Modmail" +``` + +A GUI will pop up where you can fill in the details needed for your Modmail service. Replace the `Path` with the path of your `modmail.bat` script and the `Startup directory` with the path of your Modmail folder as follow: + +
+ +You can fill in these extra details as you see fit as it's only for your own reference: + +
+ +You can also optionally specify a log file as output and error in the `I/O` tab, just be sure to create the file beforehand so you can select it in the GUI. + +
+ +And finally, click "Install Service" to install your Modmail bot as a service on your Windows system. + +
+ +By now you should have the service installed but not yet running. You can start it by using this command below in the open `nssm` Terminal from earlier: + +``` +.\nssm start modmail +``` + +
+ +You should be able to see your bot running if everything goes well. You can also verify the status of your Modmail service with: + +``` +.\nssm status modmail +``` + +And if you specified the log output file in your previous step, you should be able to see your current Modmail logs like so: + +
+ +And that's it! Your bot will now auto-start everytime you reboot your system. You can also additionally stop and restart your service with `.\nssm stop modmail` and `.\nssm restart modmail` respectively. Refer to [NSSM Documentation](http://nssm.cc/usage) for further customization as this guide is only meant to cover the basic needs adequate for standard Modmail usage. diff --git a/updating (1).md b/updating (1).md new file mode 100644 index 0000000..e2485ce --- /dev/null +++ b/updating (1).md @@ -0,0 +1,38 @@ +# Updating + +## Updating Modmail + +You can update Modmail on your Heroku account whenever changes are made to the repository. If you want to update while hosting locally (not Heroku), simply type `git pull` in your terminal and install the requirements again with `pipenv install`. + +## Forking the repo + +Before you get started, you must [fork](https://github.com/modmail-dev/modmail/fork) the repo first if you are using Heroku and want to update the bot. + +### Syncing a fork branch from the web UI + +1. On GitHub, navigate to the main page of the forked repository that you want to sync with the upstream repository. +2. Select the Sync fork dropdown. + + ![sync-fork-dropdown](https://user-images.githubusercontent.com/70805800/194696934-5333af5d-165e-4873-b5b7-bd01f0461185.png) +3. Then click Update branch. + + ![update-branch-button](https://user-images.githubusercontent.com/70805800/194696947-68891d50-a624-4901-a03d-e49564852a23.png) + +If the changes from the upstream repository cause conflicts, GitHub will prompt you to create a pull request to resolve the conflicts. + +### I want to enable automatic updates + +1. Create a GitHub account +2. [Fork](https://github.com/modmail-dev/modmail/fork) the repository +3. Add GITHUB\_TOKEN into your configuration variables from https://github.com/settings/tokens with the repo scope ([Guide](https://github.com/modmail-dev/modmail/wiki/Installation-\(cont.\)#4-how-to-obtain-your-github\_token---required-for-the-update-command-)). +4. Link your GitHub account to heroku ![](https://i.imgur.com/qjWraS0.png) +5. Turn on automatic deploys ![](https://i.imgur.com/jgUVl7f.png) +6. Restart the bot + +### I want to update the bot once + +[Click here to create a new pull request to your fork](https://github.com/modmail-dev/modmail/pull/new/master). Select `compare across forks`, make the base repository `yourusername/modmail` and ensure the branch is set to master. Put any title you want and create the pull request. On the page that comes after this, merge the pull request. + +You then want to go to your modmail application in Heroku, connect your modmail fork via the `Deploy` tab and deploy the `master` branch. + +You can turn on auto-deploy for the master branch if you don't want to go through the process of logging into Heroku and deploying the branch every time changes to the repo are made in the future. However, you will have to make a pull request to update your fork every time. diff --git a/updating.md b/updating.md index e2485ce..bfb504f 100644 --- a/updating.md +++ b/updating.md @@ -1,38 +1,36 @@ -# Updating - -## Updating Modmail +--- +description: Guide on how to update the Modmail bot. +--- -You can update Modmail on your Heroku account whenever changes are made to the repository. If you want to update while hosting locally (not Heroku), simply type `git pull` in your terminal and install the requirements again with `pipenv install`. - -## Forking the repo +# Updating -Before you get started, you must [fork](https://github.com/modmail-dev/modmail/fork) the repo first if you are using Heroku and want to update the bot. +Your Modmail is set to auto-update itself by default, but you can also run the `?update` command on your bot manually, replacing `?` with your bot prefix. -### Syncing a fork branch from the web UI +If for some reason your update command isn't working correctly, you can update your bot by going into your Modmail folder and pulling the latest changes from GitHub with the steps below. -1. On GitHub, navigate to the main page of the forked repository that you want to sync with the upstream repository. -2. Select the Sync fork dropdown. +First, determine whether you have the official Modmail repository cloned or a fork by observing the output of the command below: - ![sync-fork-dropdown](https://user-images.githubusercontent.com/70805800/194696934-5333af5d-165e-4873-b5b7-bd01f0461185.png) -3. Then click Update branch. +``` +cat .git/config +``` - ![update-branch-button](https://user-images.githubusercontent.com/70805800/194696947-68891d50-a624-4901-a03d-e49564852a23.png) +If the output shows this exact URL as shown below, -If the changes from the upstream repository cause conflicts, GitHub will prompt you to create a pull request to resolve the conflicts. +``` +[remote "origin"] + url = https://github.com/modmail-dev/modmail.git +``` -### I want to enable automatic updates +you can go ahead and run the command below to pull in the latest changes: -1. Create a GitHub account -2. [Fork](https://github.com/modmail-dev/modmail/fork) the repository -3. Add GITHUB\_TOKEN into your configuration variables from https://github.com/settings/tokens with the repo scope ([Guide](https://github.com/modmail-dev/modmail/wiki/Installation-\(cont.\)#4-how-to-obtain-your-github\_token---required-for-the-update-command-)). -4. Link your GitHub account to heroku ![](https://i.imgur.com/qjWraS0.png) -5. Turn on automatic deploys ![](https://i.imgur.com/jgUVl7f.png) -6. Restart the bot +```bash +git pull +``` -### I want to update the bot once +Else, it means that your repository is a fork and must update (aka sync) it independently. If your repository is hosted on GitHub, click on the button on your repo's GitHub URL as highlighted below: -[Click here to create a new pull request to your fork](https://github.com/modmail-dev/modmail/pull/new/master). Select `compare across forks`, make the base repository `yourusername/modmail` and ensure the branch is set to master. Put any title you want and create the pull request. On the page that comes after this, merge the pull request. +
-You then want to go to your modmail application in Heroku, connect your modmail fork via the `Deploy` tab and deploy the `master` branch. +Run the `git pull` command above locally after syncing your fork. -You can turn on auto-deploy for the master branch if you don't want to go through the process of logging into Heroku and deploying the branch every time changes to the repo are made in the future. However, you will have to make a pull request to update your fork every time. +And then, be sure to restart your bot to apply the update. diff --git a/usage-guide/configuration.md b/usage-guide/configuration.md index f1f76af..3af1bbe 100644 --- a/usage-guide/configuration.md +++ b/usage-guide/configuration.md @@ -1,3 +1,1483 @@ --- description: Configuring and customizing modmail. ---- \ No newline at end of file +--- + +# Configuration + +Modmail offers an assort of customizations to make your Modmail bot unique to your server. Most customizations can be set with `?config`, but some has its own special command, such as `?activity`. You may find all of the personalizable tweaks available for Modmail below: + +{% hint style="info" %} +All examples presume your prefix is \`?\`. +{% endhint %} + +{% hint style="warning" %} +Things covered in brackets are optional: \`\[]\` Things covered in angled brackets are required: \`<>\` +{% endhint %} + +**Quick Navigation:** + +**Moderation:** + +* [Prefix](configuration.md) +* [Mention](usage-guide/configuration/#mention-mention) + +## Moderation Configurations + +### Account Age ( account\_age ) + +_**Default:**_ No Age Threshold + +Set an amount of time a users account has to be created in order to open a ticket. + +_**Example:**_ + +* `?config set account_age P12DT3H` (stands for 12 days and 3 hours in [ISO-8601 Duration Format](https://en.wikipedia.org/wiki/ISO\_8601#Durations)) +* `?config set account_age 3 days and 5 hours` (accepted readable time) + +_**Note(s):**_ + +* To remove this restriction, do ?config del account\_age. +* See also: `guild_age`. + +### Alert on Mention ( alert\_on\_mention ) + +_**Default:**_ No + +Mentions all mods (mention) in mention channel when bot is mentioned + +_**Example:**_ + +* `?config set alert_on_mention yes` + +_**Notes:**_ + +* See also: `mention`, `mention_channel_id` + +### Prefix ( prefix ) + +The prefix of the bot + +_**Default:**_ `?` + +_**Example:**_ + +* `?config set prefix !` +* `?prefix !` + +This both result in commands now prefixed with !, for example: + +{% hint style="success" %} +!about +{% endhint %} + +_**Notes:**_ + +* If you forgot the bot prefix, Modmail will always respond to its mention (ping). +* To reset the prefix back to default: `?config del prefix` + +### Guild Age ( guild\_age ) + +The join date of the recipient user into this server must be greater than the number of days, hours, minutes or any time-interval specified by this configuration. + +_**Default:**_ No age threshold + +_**Example:**_ + +* `?config set guild_age P12DT3H` (stands for 12 days and 3 hours in [ISO-8601 Duration Format](https://en.wikipedia.org/wiki/ISO\_8601#Durations)) +* `?config set guild_age 3 days and 5 hours` (accepted readable time) + +_**Notes:**_ + +* To remove this restriction, do `{prefix}config del guild_age`. +* See also: `account_age`. + +### Reply Without Command ( reply\_without\_command ) + +_**Default:**_ Disabled + +Setting this configuration will make all non-command messages sent in the thread channel to be forwarded to the recipient without the need of `?reply`. + +_**Example:**_ + +* `?config set reply_without_command yes` +* `?config set reply_without_command no` + +_**Notes:**_ + +* See also: `anon_reply_without_command`, `plain_reply_without_command`. + +### Show Timestamps ( show\_timestamp ) + +_**Default:**_ Yes + +Shows timestamps on thread embeds + +_**Example:**_ + +* `?config set show_timestamp no` + +### Silent Alert On Commands ( silent\_alert\_on\_mention ) + +Send a message in the mention channel without mentioning all mods (mention). + +_**Default:**_ No + +_**Example:**_ + +* `?config set alert_on_mention yes` + +_**Notes:**_ This has no effect unless `alert_on_mention` is set to yes. See also: `mention`, `mention_channel_id` + +### Update Channel ID ( update\_channel\_id ) + +This is the channel where update notifications are sent to. + +_**Default:**_ Log Channel (normally `#bot-logs`) + +_**Example:**_ + +* `?config set update_channel_id 9234932582312` (9234932582312 is the channel ID)\` + +_**Notes:**_ + +* This has no effect unless `disable_autoupdates` is set to no and `update_notifications` is set to yes. +* See also: `log_channel_id` + +### Update Notifications ( update\_notifications ) + +This is the channel where update notifications are sent to. + +_**Default:**_ Yes + +_**Example:**_ + +* `?config set update_notifications no` + +_**Notes:**_ + +* This has no effect unless `disable_autoupdates` is set to no. +* See also: `update_channel_id` + +### Fallback Category ID ( fallback\_category\_id ) + +This is the category that will hold the threads when the main category is full.\n\nTo change the Fallback category, you will need to find the [category’s ID](https://support.discordapp.com/hc/en-us/articles/206346498). + +_**Default:**_ `Fallback Modmail` (created when the main category is full) + +_**Example:**_ + +* `?config set fallback_category_id 9234932582312` (`9234932582312` is the category ID) + +_**Notes:**_ + +* If the Fallback category ended up being non-existent/invalid, Modmail will create a new one. To fix this, set `fallback_category_id` to a valid category. +* See also: `main_category_id`. + +### Log Channel ID ( log\_channel\_id ) + +This is the channel where all log messages will be sent (ie. thread close message, update message, etc.).\n\nTo change the log channel, you will need to find the [channel’s ID](https://support.discordapp.com/hc/en-us/articles/206346498). The channel doesn’t necessary have to be under the `main_category`. + +_**Default:**_ `#bot-logs` (created with `?setup`) + +_**Example:**_ + +* `?config set log_channel_id 9234932582312` (9234932582312 is the channel ID) + +_**Notes:**_ + +* If the Modmail logging channel ended up being non-existent/invalid, no logs will be sent. + +### Main Category ID ( main\_category\_id ) + +This is the category where all new threads will be created.\n\nTo change the Modmail category, you will need to find the [category’s ID](https://support.discordapp.com/hc/en-us/articles/206346498). + +_**Default:**_ `Modmail` (created with `?setup`) + +_**Example:**_ + +* `?config set main_category_id 9234932582312` (`9234932582312` is the category ID)\` + +_**Notes:**_ + +* If the Modmail category ended up being non-existent/invalid, Modmail will break. To fix this, run `?setup` again or set `main_category_id` to a valid category. +* When the Modmail category is full, new channels will be created in the fallback category. +* See also: `fallback_category_id` + +### Mod Typing ( mod\_typing ) + +When this is set to `yes`, whenever a moderator starts to type in the thread channel, the recipient user will see "{bot.user.display\_name} is typing…" in their DM channel. + +_**Default:**_ Disabled + +_**Example:**_ + +* `?config set mod_typing yes` +* `?config set mod_typing no` + +_**Notes:**_ + +* See also: `mod_typing` + +### User Typing ( user\_typing ) + +When this is set to `yes`, whenever the recipient user starts to type in their DM channel, the moderator will see “{bot.user.display\_name} is typing…” in the thread channel. + +_**Default:**_ Enabled + +_**Example:**_ + +* `?config set user_typing yes` +* `?config set user_typing no` + +_**Notes:**_ + +* See also: `mod_typing`. + +### Twitch URL ( twitch\_url ) + +This channel dictates the linked Twitch channel when the activity is set to "Streaming". + +_**Default:**_ `https://www.twitch.tv/discordmodmail/` + +_**Example:**_ + +* `?config set twitch_url https://www.twitch.tv/yourchannelname/` + +_**Notes:**_ + +* This has no effect when the activity is not set to "Streaming". +* See also: `?help activity` + +### Close On Leave ( close\_on\_leave ) + +Closes a modmail thread upon user leave automatically + +_**Default:**_ No + +_**Example:**_ + +* `?config set close_on_leave yes` + +_**Notes:**_ + +* See also: `close_on_leave_reason`. + +### Confirm Thread Creation ( confirm\_thread\_creation ) + +Ensure users confirm that they want to create a new thread + +_**Default:**_ No + +_**Example:**_ + +* `?config set confirm_thread_creation yes` + +_**Notes:**_ + +* See also: `confirm_thread_creation_title`, `confirm_thread_response`, `confirm_thread_creation_accept`, `confirm_thread_creation_deny` + +### Mention ( mention ) + +This is the message above user information for when a new thread is created in the channel. + +_**Default:**_ `@here` + +_**Example:**_ + +* `?config set mention Yo~ Here's a new thread for ya!` +* `?mention Yo~ Here's a new thread for ya!` + +_**Notes:**_ + +* To disable mention, use command `?mention disable`. +* See also: `?help mention`. + +### Require Close Reason ( require\_close\_reason ) + +Require a reason to close threads. + +_**Default:**_ No + +_**Example:**_ + +* `?config set require_close_reason yes` + +### Thread Auto Close ( thread\_auto\_close ) + +Setting this configuration will close threads automatically after the number of days, hours, minutes or any time-interval specified by this configuration. + +_**Default:**_ Never + +_**Example:**_ + +* `?config set thread_auto_close P12DT3H` (stands for 12 days and 3 hours in [ISO-8601 Duration Format](https://en.wikipedia.org/wiki/ISO\_8601#Durations)) +* `?config set thread_auto_close 3 days and 5 hours` (accepted readable time) + +_**Notes:**_ + +* To disable auto close, do `?config del thread_auto_close`. +* To prevent a thread from auto-closing, do `?close cancel`. +* See also: `thread_auto_close_silently`, `thread_auto_close_response`. + +### Thread Cooldown ( thread\_cooldown ) + +Specify the time required for the recipient to wait before allowed to create a new thread. + +_**Default:**_ Never + +_**Example:**_ + +* `?config set thread_cooldown P12DT3H` (stands for 12 days and 3 hours in [ISO-8601 Duration Format](https://en.wikipedia.org/wiki/ISO\_8601#Durations)) +* `?config set thread_cooldown 3 days and 5 hours` (accepted readable time) + +_**Notes:**_ + +* To disable thread cooldown, do `?config del thread_cooldown`. + +### Thread Move Notify ( thread\_move\_notify ) + +Notify the recipient if the thread was moved. + +_**Default:**_ No + +_**Example:**_ + +* `?config set thread_move_notify yes` +* `?config set thread_move_notify no` + +_**Notes:**_ + +* See also: `thread_move_title`, `thread_move_response`, `thread_move_notify_mods`. + +### Thread Move Notify Mods ( thread\_move\_notify\_mods ) + +Notify mods again after the thread is moved + +_**Default:**_ No + +_**Example:**_ + +* `?config set thread_move_notify_mods yes` +* `?config set thread_move_notify_mods no` + +_**Notes:**_ + +* See also: `thread_move_title`, `thread_move_response`, `thread_move_notify`. + +### Use Regex Autotrigger ( use\_regex\_autotrigger ) + +Whether to use regex to compare in autotriggers. + +_**Default:**_ No + +_**Example:**_ + +* `?config set use_regex_autotrigger yes` + +_**Notes:**_ + +{% hint style="danger" %} +This is meant for advanced user that understand regular expressions. +{% endhint %} + +* You can test it out with https://regexr.com on `PCRE (Server)` mode +* See command: `autotrigger` + +### Plain Reply Without Command ( plain\_reply\_without\_command ) + +Setting this configuration will make all non-command messages sent in the thread channel to be forwarded to the recipient in a plain form without the need of `?reply`. + +_**Default:**_ Disabled + +_**Example:**_ + +* `?config set plain_reply_without_command yes` +* `?config set plain_reply_without_command no` + +_**Notes:**_ + +* See also: `reply_without_command`, `anon_reply_without_command`. + +### Anonymous Snippets ( anonymous\_snippets ) + +Sends snippets anonymously. + +_**Default:**_ No + +_**Example:**_ + +* `?config set anonymous_snippets yes` + +_**Notes:**_ + +* See also: `anon_avatar_url`, `anon_tag`, `plain_snippets`. + +## Appearance Configurations + +### Blocked Emoji ( blocked\_emoji ) + +This is the emoji added to the message when when a Modmail action is invoked unsuccessfully (ie. DM Modmail when blocked, failed to reply, etc.). + +_**Default:**_ 🚫 + +_**Example:**_ + +* `?config set blocked_emoji 🙅‍` + +_**Notes:**_ + +* You can disable `blocked_emoji` with `?config set blocked_emoji disable`. +* Custom/animated emojis are also supported, however, the emoji must be added to the server. +* See also: `sent_emoji`. + +### Close Emoji ( close\_emoji ) + +This is the emoji the recipient can click to close a thread themselves. The emoji is automatically added to the `thread_creation_response` embed. + +_**Default:**_ 🔒 + +_**Example:**_ + +* `?config set close_emoji 👍‍` + +_**Notes:**_ + +* This will only have an effect when `recipient_thread_close` is enabled. +* See also: `recipient_thread_close`. + +### Confirm Thread Creation Accept ( confirm\_thread\_creation\_accept ) + +Emoji to accept thread creation + +_**Default:**_ \u2705 + +_**Example:**_ + +* `?config set confirm_thread_creation_accept \u2611` + +_**Notes:**_ + +* This has no effect unless `confirm_thread_creation` is set +* See also: `confirm_thread_creation`, `confirm_thread_creation_title`, `confirm_thread_response`, `confirm_thread_creation_deny` + +### Confirm Thread Creation Deny ( confirm\_thread\_creation\_deny ) + +Emoji to cancel thread creation + +_**Default:**_ \uD83D\uDEAB + +_**Example:**_ + +* `?config set confirm_thread_creation_deny \u26D4` + +_**Notes:**_ + +* This has no effect unless `confirm_thread_creation` is set +* See also: `confirm_thread_creation`, `confirm_thread_creation_title`, `confirm_thread_response`, `confirm_thread_creation_accept` + +### Error Color ( error\_color ) + +This is the color for Modmail when anything goes wrong, unsuccessful commands, or a stern warning. + +_**Default:**_ Discord Red [#E74C3C](https://placehold.it/100/e74c3c?text=+) + +_**Example:**_ + +* `?config set error_color ocean blue` +* `?config set error_color ff1242` +* `?config set error_color #ff1242` +* `?config set error_color fa1` + +_**Notes:**_ + +* Available color names can be found on [Color Options](https://docs.modmail.dev/old-docs/color-names). +* See also: `main_color`, `mod_color`, `recipient_color`. + +### Main Color ( main\_color ) + +This is the main color for Modmail (help/about/ping embed messages, subscribe, move, etc.). + +_**Default:**_ Discord Blurple [#7289DA](https://placehold.it/100/7289da?text=+) + +_**Example:**_ + +* `?config set main_color olive green` +* `?config set main_color 12de3a` +* `?config set main_color #12de3a` +* `?config set main_color fff` + +_**Notes:**_ + +* Available color names can be found on [Color Options](https://docs.modmail.dev/old-docs/color-names). +* See also: `error_color`, `mod_color`, `recipient_color`. + +### Mod Color ( mod\_color ) + +This is the color of the messages sent by the moderators, this applies to messages within in the thread channel and the DM thread messages received by the recipient. + +_**Default:**_ Discord Green [#2ECC71](https://placehold.it/100/2ecc71?text=+) + +_**Example:**_ + +* `?config set mod_color dark beige` +* `?config set mod_color cb7723` +* `?config set mod_color #cb7723` +* `?config set mod_color c4k` + +_**Notes:**_ + +* Available color names can be found on [Color Options](https://docs.modmail.dev/old-docs/color-names). +* See also: `recipient_color`, `main_color`, `error_color`. + +### React To Contact Emoji ( react\_to\_contact\_emoji ) + +An emoji which is tracked in `react_to_contact_message` + +_**Default:**_ \u2705 + +_**Example:**_ + +* `?config set react_to_contact_emoji \u2705` + +_**Notes:**_ + +* See also: `react_to_contact_message \u2705` + +### Recipient Color ( recipient\_color ) + +This is the color of the messages sent by the recipient, this applies to messages received in the thread channel. + +_**Default:**_ "Discord Gold [#F1C40F](https://placehold.it/100/f1c40f?text=+) + +_**Example:**_ + +* `?config set recipient_color dark beige` +* `?config set recipient_color cb7723` +* `?config set recipient_color #cb7723` +* `?config set recipient_color c4k` + +_**Notes:**_ + +* Available color names can be found on [Color Options](https://docs.modmail.dev/old-docs/color-names). +* See also: `mod_color`, `main_color`, `error_color`. + +### Sent Emoji ( sent\_emoji ) + +This is the emoji added to the message when when a Modmail action is invoked successfully (ie. DM Modmail, edit message, etc.). + +_**Default:**_ ✅ + +_**Example:**_ + +* `?config set sent_emoji ✨` + +_**Notes:**_ + +* You can disable `sent_emoji` with `?config set sent_emoji disable`. +* Custom/animated emojis are also supported, however, the emoji must be added to the server. +* See also: `blocked_emoji`. + +### Show Log URL Button ( show\_log\_url\_button ) + +Shows the button to open the Log URL. + +_**Default:**_ No + +_**Example:**_ + +* `?config set show_log_url_button yes` + +## Thread Appearance + +### Use Random Channel Name ( use\_random\_channel\_name ) + +When this is set to `yes`, new thread channels will be named with random characters tied to their user ID. + +_**Default:**_ No + +_**Example:**_ + +* `?config set use_random_channel_name yes` +* `?config set use_random_channel_name no` + +_**Notes:**_ + +{% hint style="warning" %} +This config is suitable for servers in Server Discovery to comply with channel name restrictions. +{% endhint %} + +{% hint style="danger" %} +This cannot be applied with \`use\_timestamp\_channel\_name\`, \`use\_nickname\_channel\_name\`, or \`use\_user\_id\_channel\_name\`. +{% endhint %} + +* See also: `use_timestamp_channel_name`, `use_user_id_channel_name`, `use_nickname_channel_name`. + +### Use Timestamp Channel Name ( use\_timestamp\_channel\_name ) + +When this is set to `yes`, new thread channels will be named with the recipient's account creation date instead of the recipient's name. + +_**Default:**_ No + +_**Example:**_ + +* `?config set use_timestamp_channel_name yes` +* `?config set use_timestamp_channel_name no` + +_**Notes:**_ + +{% hint style="warning" %} +This config is \*\*NOT\*\* suitable for servers in Server Discovery to comply with channel name restrictions. +{% endhint %} + +{% hint style="danger" %} +This cannot be applied with \`use\_user\_id\_channel\_name\`, \`use\_random\_channel\_name\` or \`use\_nickname\_channel\_name\`. +{% endhint %} + +* See also: `use_user_id_channel_name`, `use_nickname_channel_name`, `use_random_channel_name`. + +### Use User ID Channel Name ( use\_user\_id\_channel\_name ) + +When this is set to `yes`, new thread channels will be named with the recipient's ID instead of the recipient's name. + +_**Default:**_ No + +_**Example:**_ + +* `?config set use_user_id_channel_name yes` +* `?config set use_user_id_channel_name no` + +_**Notes:**_ + +{% hint style="warning" %} +This config is suitable for servers in Server Discovery to comply with channel name restrictions. +{% endhint %} + +{% hint style="danger" %} +This cannot be applied with \`use\_timestamp\_channel\_name\`, \`use\_random\_channel\_name\` or \`use\_nickname\_channel\_name\`. +{% endhint %} + +* See also: `use_timestamp_channel_name`, `use_nickname_channel_name`, `use_random_channel_name`. + +### Use Nickname Channel Name ( use\_nickname\_channel\_name ) + +When this is set to `yes`, new thread channels will be named with the recipient's nickname instead of the recipient's name. + +_**Default:**_ + +_**Example:**_ + +* `?config set use_nickname_channel_name yes` +* `?config set use_nickname_channel_name no` + +_**Notes:**_ + +{% hint style="warning" %} +This config is suitable for servers in Server Discovery to comply with channel name restrictions. +{% endhint %} + +{% hint style="danger" %} +This cannot be applied with \`use\_timestamp\_channel\_name\`, \`use\_random\_channel\_name\` or \`use\_user\_id\_channel\_name\`. +{% endhint %} + +* See also: `use_timestamp_channel_name`, `use_user_id_channel_name`, `use_random_channel_name`. + +### Use Hoisted Top Role ( use\_hoisted\_top\_role ) + +Controls if only hoisted roles are evaluated when finding top role. + +_**Default:**_ Yes + +_**Example:**_ + +* `?config set use_hoisted_top_role yes` +* `?config set use_hoisted_top_role no` + +_**Notes:**_ + +* Top role is displayed in embeds when replying or adding/removing users to a thread in the case mod\_tag and anon\_username are not set. +* If this configuration is enabled, only roles that are hoisted (displayed seperately in member list) will be used. If a user has no hoisted roles, it will return 'None'. +* If you would like to display the top role of a user regardless of if it's hoisted or not, disable `use_hoisted_top_role`. + +### Thread Show Account Age ( thread\_show\_account\_age ) + +Shows account age on first message sent in thread channels to mods + +_**Default:**_ Yes + +_**Example:**_ + +* `?config set thread_show_account_age no` + +_**Notes:**_ + +* See also: `thread_show_roles`, `thread_show_join_age` + +### Thread Show Join Age ( thread\_show\_join\_age ) + +Shows join age on first message sent in thread channels to mods + +_**Default:**_ Yes + +_**Example:**_ + +* `?configconfig set thread_show_join_age no` + +_**Notes:**_ + +* See also: `thread_show_account_age`, `thread_show_roles`. + +### Thread Show Roles ( thread\_show\_roles ) + +Shows roles on first message sent in thread channels to mods + +_**Default:**_ Yes + +_**Example:**_ + +* `?config set thread_show_account_age no` + +_**Notes:**_ + +* See also: `thread_show_roles`, `thread_show_join_age`. + +### Mod Tag ( mod\_tag ) + +This is the name tag in the “footer” section of the embeds sent by moderators in the recipient DM and thread channel. + +_**Default:**_ The moderator's highest role + +_**Example:**_ + +* `?config set mod_tag Moderator` + +_**Notes:**_ + +{% hint style="warning" %} +When the message is sent anonymously, \`anon\_tag\` is used instead. +{% endhint %} + +* See also: `anon_tag`. + +### Anon Tag ( anon\_tag ) + +This is the name tag in the “footer” section of the embeds sent by anonymous moderators in the recipient DM. + +_**Default:**_ "Response" + +_**Example:**_ + +* `?config set anon_tag Support Agent` + +_**Notes:**_ + +* See also: `anon_avatar_url`, `anon_username`, `mod_tag`. + +### Anon Avatar URL ( anon\_avatar\_url ) + +This is the avatar of the embeds sent by anonymous moderators in the recipient DM. + +_**Default:**_ Server avatar + +_**Example:**_ + +* `?config set anon_avatar_url https://path.to/your/avatar.png` (you will need to upload the avatar to somewhere) + +_**Notes:**_ + +* See also: `anon_username`, `anon_tag`. + +### Anon Username ( anon\_username ) + +This is the name in the “author” section of the embeds sent by anonymous moderators in the recipient DM. + +_**Default:**_ Fallback on `mod_tag` + +_**Example:**_ + +* `?config set anon_username Incognito Mod` + +_**Notes:**_ + +* See also: `anon_avatar_url`, `anon_tag`. + +### Transfer Reactions ( transfer\_reactions ) + +Transfer users reactions to mods and vice versa _(If someone reacts to a thread message the other party will see it.)_ + +_**Default:**_ Yes + +_**Example:**_ + +* `?config set transfer_reactions no` + +## Thread Responses + +### Close On Leave Reason ( close\_on\_leave\_reason ) + +Reason for closing the thread once member leaves + +_**Default:**_ The recipient has left the server. + +_**Example:**_ + +* `?config set close_on_leave_reason Member left` + +_**Notes:**_ + +* This has no effect unless `close_on_leave` is set. +* See also: `close_on_leave`. + +### Confirm Thread Creation Title ( confirm\_thread\_creation\_title ) + +Title for the embed message sent to users to confirm a thread creation + +_**Default:**_ Confirm thread creation + +_**Example:**_ + +* `?config set confirm_thread_creation_title Are you sure you want to create a new thread?` + +_**Notes:**_ + +* See also: `confirm_thread_creation`, `confirm_thread_response`, `confirm_thread_creation_accept`, `confirm_thread_creation_deny` + +### Confirm Thread Response ( confirm\_thread\_response ) + +Description for the embed message sent to users to confirm a thread creation + +_**Default:**_ React to confirm thread creation which will directly contact the moderators + +_**Example:**_ + +* `?config set confirm_thread_response React to confirm` + +_**Notes:**_ + +* See also: `confirm_thread_creation`, `confirm_thread_creation_title`, `confirm_thread_creation_accept`, `confirm_thread_creation_deny` + +### Cooldown Thread Response ( cooldown\_thread\_response ) + +The description of the message embed when the user has a cooldown before creating a new thread. + +_**Default:**_ Your cooldown ends {delta}. Try contacting me then. + +{% hint style="info" %} +\`{delta}\` will be replaced with whatever time you gave it. +{% endhint %} + +_**Example:**_ + +* `?config set cooldown_thread_response Be patient! You are on cooldown, wait {delta} more.` + +_**Notes:**_ + +* "Only has an effect when `thread_cooldown` is set +* Must have a {delta} included which will be replaced with the duration of time. +* See also: `cooldown_thread_title`. + +### Cooldown Thread Title ( cooldown\_thread\_title ) + +The title of the message embed when the user has a cooldown before creating a new thread. + +_**Default:**_ Message not sent! + +_**Example:**_ + +* `?config set cooldown_thread_title Error` + +_**Notes:**_ + +* Only has an effect when `thread_cooldown` is set +* See also: `cooldown_thread_response`. + +### Disabled Current Thread Footer ( disabled\_current\_thread\_footer ) + +The footer of the message embed when Modmail DM is disabled and user DMs Modmail from existing thread. + +_**Default:**_ Please try again later... + +_**Example:**_ + +* `?config set disabled_current_thread_footer Message back!` + +_**Notes:**_ + +* Only has an effect when `{prefix}disable all` is set. +* See also: `disabled_current_thread_title`, `disabled_current_thread_response`, `disabled_new_thread_footer`. + +### Disabled Current Thread Response ( disabled\_current\_thread\_response ) + +The body of the message embed when Modmail DM is disabled and user DMs Modmail from existing thread. + +_**Default:**_ We are not accepting any messages. + +_**Example:**_ + +* `?config set disabled_current_thread_response On break right now.` + +_**Notes:**_ + +* Only has an effect when `{prefix}disable all` is set. +* See also: `disabled_current_thread_title`, `disabled_current_thread_footer`, `disabled_new_thread_response`. + +### Disabled Current Thread Title ( disabled\_current\_thread\_title ) + +The title of the message embed when Modmail DM is disabled and user DMs Modmail from existing thread. + +_**Default:**_ Not Delivered. + +_**Example:**_ + +* `?config set disabled_current_thread_title Unavailable` + +_**Notes:**_ + +* Only has an effect when `{prefix}disable all` is set. +* See also: `disabled_current_thread_response`, `disabled_current_thread_footer`, `disabled_new_thread_title`. + +### Disabled New Thread Footer ( disabled\_new\_thread\_footer ) + +The footer of the message embed when Modmail new thread creation is disabled and user tries to create a new thread. + +_**Default:**_ Please try again later... + +_**Example:**_ + +* `?config set disabled_new_thread_footer Contact us later` + +_**Notes:**_ + +* Only has an effect when `{prefix}disable` or `{prefix}disable all` is set. +* See also: `disabled_new_thread_title`, `disabled_new_thread_response`, `disabled_current_thread_footer`. + +### Disabled New Thread Response ( disabled\_new\_thread\_response ) + +The body of the message embed when Modmail new thread creation is disabled and user tries to create a new thread. + +_**Default:**_ We are not accepting new threads. + +_**Example:**_ + +* `?config set disabled_new_thread_response Our working hours is between 8am - 6pm EST.` + +_**Notes:**_ + +* Only has an effect when `{prefix}disable` or `{prefix}disable all` is set. +* See also: `disabled_new_thread_title`, `disabled_new_thread_footer`, `disabled_current_thread_response`. + +### Disabled New Thread Title ( disabled\_new\_thread\_title ) + +The title of the message embed when Modmail new thread creation is disabled and user tries to create a new thread. + +_**Default:**_ Not Delivered. + +_**Example:**_ + +* `?config set disabled_new_thread_title Closed` + +_**Notes:**_ + +* Only has an effect when `{prefix}disable` or `{prefix}disable all` is set. +* See also: `disabled_new_thread_response`, `disabled_new_thread_footer`, `disabled_current_thread_title`. + +### Private Added To Group Description Anon ( private\_added\_to\_group\_description\_anon ) + +This is the message embed content sent to the recipient that is just added to a thread when adduser is used anonymously. + +_**Default:**_ A moderator has added you to a Modmail thread. + +_**Example:**_ + +* `?config set private_added_to_group_description_anon Any message sent here will be sent to all other thread recipients.` + +_**Notes:**_ + +* When adduser (no anon) is used, `private_added_to_group_description` is used instead. +* The public\_ variant is used when sending to other thread recipients. +* See also: `private_added_to_group_title`, `public_added_to_group_description_anon` + +### Private Added To Group Response ( private\_added\_to\_group\_response ) + +This is the message embed content sent to the recipient that is just added to a thread. + +_**Default:**_ "\{{moderator.name\}} has added you to a Modmail thread." + +_**Example:**_ + +* `?config set private_added_to_group_description Any message sent here will be sent to all otherthread recipients.` + +_**Notes:**_ + +* You may use the `{{moderator}}` variable for access to the [Member](https://discordpy.readthedocs.io/en/latest/api.html#discord.Member) that added the user. +* When anonadduser is used, `private_added_to_group_description_anon` is used instead. +* The public\_ variant is used when sending to other thread recipients. +* See also: `private_added_to_group_title`, `public_added_to_group_description` + +### Private Added To Group Title ( private\_added\_to\_group\_title ) + +This is the message embed title sent to the recipient that is just added to a thread. + +_**Default:**_ New Thread (Group) + +_**Example:**_ + +* `?config set private_added_to_group_title Welcome to this new group thread!` + +_**Notes:**_ + +* The public\_ variant is used when sending to other thread recipients. +* See also: `private_added_to_group_description`, `public_added_to_group_title` + +### Private Removed From Group Description Anon ( private\_removed\_from\_group\_description\_anon ) + +This is the message embed content sent to the recipient that is just removed from a thread when removeuser is used anonymously. + +_**Default:**_ A moderator has removed you from the Modmail thread. + +_**Example:**_ + +* `?config set private_removed_from_group_description_anon You are permenantly removed from this thread.` + +_**Notes:**_ + +* When adduser (no anon) is used, `private_removed_from_group_description` is used instead. +* The public\_ variant is used when sending to other thread recipients. +* See also: `private_removed_from_group_title`, `public_removed_from_group_description_anon` + +### Private Removed From Group Response ( private\_removed\_from\_group\_response ) + +This is the message embed content sent to the recipient that is just removed from a thread. + +_**Default:**_ "\{{moderator.name\}} has removed you from the Modmail thread." + +_**Example:**_ + +* `?config set private_removed_from_group_description Bye` + +_**Notes:**_ + +* You may use the `{{moderator}}` variable for access to the [Member](https://discordpy.readthedocs.io/en/latest/api.html#discord.Member) that added the user. +* When anonremoveuser is used, `private_removed_from_group_description_anon` is used instead. +* The public\_ variant is used when sending to other thread recipients. +* See also: `private_removed_from_group_title`, `public_removed_from_group_description` + +### Private Removed From Group Title ( private\_removed\_from\_group\_title ) + +This is the message embed title sent to the recipient that is just removed from a thread. + +_**Default:**_ Removed From Thread (Group) + +_**Example:**_ + +* `?config set private_removed_from_group_title Welcome to this new group thread!` + +_**Notes:**_ + +* The public\_ variant is used when sending to other thread recipients. +* See also: `private_removed_from_group_description`, `public_removed_from_group_title` + +### Public Added To Group Description Anon ( public\_added\_to\_group\_description\_anon ) + +This is the message embed content sent to all other recipients when someone is added to the thread when adduser is used anonymously. + +_**Default:**_ "A moderator has added \{{users\}} to the Modmail thread." + +_**Example:**_ + +* `?config set public_added_to_group_description_anon Any message sent here will be sent to all other thread recipients.` + +_**Notes:**_ + +* When adduser (no anon) is used, `public_added_to_group_description` is used instead. +* The private\_ variant is used when sending to the new user. +* See also: `public_added_to_group_title`, `private_added_to_group_description_anon` + +### Public Added To Group Response ( public\_added\_to\_group\_response ) + +This is the message embed content sent to all other recipients when someone is added to the thread. + +_**Default:**_ "\{{moderator.name\}} has added \{{users\}} to the Modmail thread." + +_**Example:**_ + +* `?config set public_added_to_group_response Welcome {users}!` + +_**Notes:**_ + +* You may use the `{{moderator}}` variable for access to the [Member](https://discordpy.readthedocs.io/en/latest/api.html#discord.Member) that added the user. +* When anonadduser is used, `public_added_to_group_description_anon` is used instead. +* The private\_ variant is used when sending to the new user. +* See also: `public_added_to_group_title`, `private_added_to_group_description` + +### Public Added To Group Title ( public\_added\_to\_group\_title ) + +This is the message embed title sent to all other recipients when someone is added to the thread. + +_**Default:**_ New User + +_**Example:**_ + +* `?config set public_added_to_group_title Welcome to our new user!` + +_**Notes:**_ + +* The private\_ variant is used when sending to the new user. +* See also: `private_added_to_group_title`, `private_added_to_group_title` + +### Public Removed From Group Description Anon ( public\_removed\_from\_group\_description\_anon ) + +This is the message embed content sent to all other recipients when someone is removed from the thread when removeuser is used anonymously. + +_**Default:**_ "A moderator has removed \{{users\}} from the Modmail thread." + +_**Example:**_ + +* `?config set public_removed_from_group_description_anon Goodbye {users}!` + +_**Notes:**_ + +* When adduser (no anon) is used, `public_removed_from_group_description` is used instead. +* The private\_ variant is used when sending to the new user. +* See also: `public_removed_from_group_title`, `private_removed_from_group_description_anon` + +### Public Removed From Group Response ( public\_removed\_from\_group\_response ) + +This is the message embed content sent to all other recipients when someone is removed from the thread. + +_**Default:**_ "\{{moderator.name\}} has removed \{{users\}} from the Modmail thread." + +_**Example:**_ + +* `?config set public_removed_from_group_response Goodbye {users}!` + +_**Notes:**_ + +* You may use the `{{moderator}}` variable for access to the [Member](https://discordpy.readthedocs.io/en/latest/api.html#discord.Member) that added the user. +* When anonremoveuser is used, `public_removed_from_group_description_anon` is used instead. + +### Public Removed From Group Title ( public\_removed\_from\_group\_title ) + +This is the message embed title sent to all other recipients when someone is removed from the thread. + +_**Default:**_ User Removed + +_**Example:**_ + +* `?config set public_removed_from_group_title User is now gone!` + +_**Notes:**_ + +* The private\_ variant is used when sending to the new user. +* See also: `private_removed_from_group_title`, `private_removed_from_group_title` + +### React To Contact Message ( react\_to\_contact\_message ) + +A message ID where reactions are tracked. If the `react_to_contact_emoji` is added, the bot opens a thread with them. + +_**Default:**_ None + +_**Example:**_ + +* `?config set react_to_contact_message 773575608814534717` + +_**Notes:**_ + +* See also: `react_to_contact_emoji` + +### Recipient Thread Close ( recipient\_thread\_close ) + +Setting this configuration will allow recipients to use the `close_emoji` to close the thread themselves. + +_**Default:**_ Disabled + +_**Example:**_ + +* `?config set recipient_thread_close yes` +* `?config set recipient_thread_close no` + +_**Notes:**_ + +* The close emoji is dictated by the configuration `close_emoji`. +* See also: `close_emoji`. + +### Thread Auto Close Response ( thread\_auto\_close\_response ) + +This is the message to display when the thread when the thread auto-closes. + +_**Default:**_ "This thread has been closed automatically due to inactivity after \{{timeout\}}." + +_**Example:**_ + +* `?config set thread_auto_close_response Your close message here.` + +_**Notes:**_ + +* Its possible to use `{{timeout}}` as a placeholder for a formatted timeout text. +* This will not have an effect when `thread_auto_close_silently` is enabled. +* Discord flavoured markdown is fully supported in `thread_auto_close_response`. +* See also: `thread_auto_close`, `thread_auto_close_silently`. + +### Thread Auto Close Silently ( thread\_auto\_close\_silently ) + +Setting this configuration will close silently when the thread auto-closes. + +_**Default:**_ No + +_**Example:**_ + +* `?config set thread_auto_close_silently yes` +* `?config set thread_auto_close_silently no` + +_**Notes:**_ + +* This will only have an effect when `thread_auto_close` is set. +* See also: `thread_auto_close`. + +### Thread Cancelled ( thread\_cancelled ) + +This is the message to display when a thread times out and creation is cancelled. + +_**Default:**_ "Cancelled" + +_**Example:**_ + +* `?config set thread_cancelled Gone.` + +### Thread Close Footer ( thread\_close\_footer ) + +This is the message embed footer sent to the recipient upon the closure of a thread. + +_**Default:**_ "Replying will create a new thread" + +_**Example:**_ + +* `?config set thread_close_footer Bye!` + +_**Notes:**_ + +* See also: `thread_close_title`, `thread_close_response`, `thread_creation_footer`. + +### Thread Close Response ( thread\_close\_response ) + +This is the message embed content sent to the recipient upon the closure of a thread. + +There are three variables you can use within the thread close message: - `closer`: the discord User object of the user who closed the thread. - `logkey`: the key for the thread logs. (ie. 51ecd946dc29) - `loglink`: the full link URL to the thread logs. (ie. https://logviewer.herokuapp.com/logs/51ecd946dc29) + +_**Default:**_ "\{{closer.mention\}} has closed this Modmail thread" + +_**Example:**_ + +* `?config set thread_close_response Your message is appriciated!` + +To use variables in the thread close message: + +* `?config set thread_close_response {closer.mention} has closed this thread, here's your log key: **`{logkey}`**.` + +_**Notes:**_ + +* When `recipient_thread_close` is enabled and the recipient closed their own thread, `thread_self_close_response` is used instead of this configuration. +* You may use the `{{closer}}` variable for access to the [Member](https://discordpy.readthedocs.io/en/latest/api.html#discord.Member) that closed the thread. +* Discord flavoured markdown is fully supported in `thread_close_response`. +* See also: `thread_close_title`, `thread_close_footer`, `thread_self_close_response`, `thread_creation_response`. + +### Thread Close Title ( thread\_close\_title ) + +This is the message embed title sent to the recipient upon the closure of a thread. + +_**Default:**_ "Thread Closed" + +_**Example:**_ + +* `?config set thread_close_title Farewell!` + +_**Notes:**_ + +* See also: `thread_close_response`, `thread_close_footer`, `thread_creation_title`. + +### Thread Contact Silently ( thread\_contact\_silently ) + +Setting this configuration will always open a new thread silently in contact. + +_**Default:**_ No + +_**Example:**_ + +* `?config set thread_contact_silently yes` +* `?config set thread_contact_silently no` + +_**Notes:**_ + +* Works like `{prefix}contact silent` for every new thread. + +### Thread Creation Contact Response ( thread\_creation\_contact\_response ) + +This is the message embed description sent to recipients when contacted by a mod. + +_**Default:**_ "\{{creator.name\}} has opened a Modmail thread." + +_**Example:**_ + +* `?config set thread_creation_contact_response New thread opened.` + +_**Notes:**_ + +* You may use the `{{creator}}` variable for access to the [Member](https://discordpy.readthedocs.io/en/latest/api.html#discord.Member) that created the thread. +* `thread_creation_self_contact_response` is used when contacted by self. +* See also: `thread_creation_contact_title`, `thread_creation_self_contact_response`. + +### Thread Creation Contact Title ( thread\_creation\_contact\_title ) + +This is the message embed title sent to recipients when contacted. + +_**Default:**_ "New Thread" + +_**Example:**_ + +* `?config set thread_creation_contact_title New Message!` + +_**Notes:**_ + +* See also: `thread_creation_self_contact_response`, `thread_creation_contact_response`. + +### Thread Creation Footer ( thread\_creation\_footer ) + +This is the message embed footer sent to the recipient upon the creation of a new thread. + +_**Default:**_ "Your message has been sent" + +_**Example:**_ + +* \`?config set thread\_creation\_footer Please Hold... + +_**Notes:**_ + +* This is used in place of `thread_self_closable_creation_footer` when `recipient_thread_close` is enabled. +* See also: `thread_creation_title`, `thread_creation_response`, `thread_self_closable_creation_footer`, `thread_close_footer`. + +### Thread Creation Response ( thread\_creation\_response ) + +This is the message embed content sent to the recipient upon the creation of a new thread. + +_**Default:**_ "The staff team will get back to you as soon as possible." + +_**Example:**_ + +* `?config set thread_creation_response You will be contacted shortly.` + +_**Notes:**_ + +* Discord flavoured markdown is fully supported in `thread_creation_response`. +* See also: `thread_creation_title`, `thread_creation_footer`, `thread_close_response`. + +### Thread Creation Self Contact Response ( thread\_creation\_self\_contact\_response ) + +This is the message embed description sent to recipients when self-contacted. + +_**Default:**_ "You have opened a Modmail thread." + +_**Example:**_ + +* `?config set thread_creation_self_contact_response You contacted yourself.` + +_**Notes:**_ + +* `thread_creation_contact_response` is used when contacted by another user. +* See also: `thread_creation_contact_title`, `thread_creation_contact_response`. + +### Thread Creation Title ( thread\_creation\_title ) + +This is the message embed title sent to the recipient upon the creation of a new thread. + +_**Default:**_ "Thread Created" + +_**Example:**_ + +* `?config set thread_creation_title Hello!` + +_**Notes:**_ + +* See also: `thread_creation_response`, `thread_creation_footer`, `thread_close_title`. + +### Thread Move Response ( thread\_move\_response ) + +This is the message to display to the user when the thread is moved. + +_**Default:**_ This thread has been moved. + +_**Example:**_ + +* `?config set thread_move_response This thread has been moved to another category for review!` + +_**Notes:**_ + +* Only has an effect when `thread_move_notify` is on. +* See also: `thread_move_title`, `thread_move_notify`. + +### Thread Move Title ( thread\_move\_title ) + +The title of the message embed when a thread is moved. + +_**Default:**_ Thread Moved + +_**Example:**_ + +* `?config set thread_move_title Thread transferred to another channel!` + +_**Notes:**_ -See also: `thread_move_notify`, `thread_move_notify_mods`, `thread_move_response`. + +### Thread Self Closable Creation Footer ( thread\_self\_closable\_creation\_footer ) + +This is the message embed footer sent to the recipient upon the creation of a new thread. + +_**Default:**_ "Click the lock to close the thread" + +_**Example:**_ + +* `?config set thread_self_closable_creation_footer Please Hold...` + +_**Notes:**_ + +* This is used in place of `thread_creation_footer` when `recipient_thread_close` is disabled. +* See also: `thread_creation_title`, `thread_creation_response`, `thread_creation_footer`. + +### Thread Self Close Response ( thread\_self\_close\_response ) + +This is the message embed content sent to the recipient upon the closure of a their own thread. + +_**Default:**_ "You have closed this Modmail thread." + +_**Example:**_ + +* `?config set thread_self_close_response You have closed your own thread...` + +_**Notes:**_ + +* When `recipient_thread_close` is disabled or the thread wasn't closed by the recipient, `thread_close_response` is used instead of this configuration. +* You may use the `{{closer}}` variable for access to the [Member](https://discordpy.readthedocs.io/en/latest/api.html#discord.Member) that closed the thread. +* `{{loglink}}` can be used as a placeholder substitute for the full URL linked to the thread in the log viewer and `{{loglink}}` for the unique key (ie. s3kf91a) of the log. +* Discord flavoured markdown is fully supported in `thread_self_close_response`. -See also: `thread_close_title`, `thread_close_footer`, `thread_close_response`. + +## `.env` Config Options + +**The following is a list of config options that can **_**ONLY**_** be added by editing the `.env` file. Please use whichever guide you followed to set up the bot to see how to add these variables.** + +{% hint style="danger" %} +It is recommended you avoid and ignore changing any of these you do not fully understand +{% endhint %} + +| Option | Description | Required | Usage | +| ------------------------ | :---------------------------------------------------------------------------: | :------: | :-------------------------------------------------------------------------------------: | +| modmail\_guild\_id | Inbox server for tickets | No | `MODMAIL_GUILD_ID = GUILDIDHERE` | +| guild\_id | Main server the bot is in | Yes | `GUILD_ID = GUILDIDHERE` | +| log\_url\_prefix | Default is `/logs` | Yes | `LOG_URL_PREFIX = PREFIX` | +| mongo\_uri | The connection uri for the database | Yes | `MONGO_URI = mongodb+srv://Papiersnipper:mypassword123@modmail-rdm99.mongodb.net/` | +| connection\_uri | The connection uri for the database | Yes | `CONNECTION_URI = mongodb+srv://Papiersnipper:mypassword123@modmail-rdm99.mongodb.net/` | +| owners | ID's of the users who will have owner perms | Yes | `OWNERS = 1234,5678,91011` | +| enable\_presence\_intent | Enables the presence intent, required for some plugins. Uses extra resources. | No | `ENABLE_PRESENCE_INTENT = True` | +| registry\_plugins\_only | Disallows the ability to download plugins that aren’t in the plugin registry. | No | `REGISTRY_PLUGINS_ONLY = True` | +| token | The bots token | Yes | `TOKEN = MTAyMjk2NTA4MzYxtewgw3eNw.thisis.afaketoken-WGjwfvQ` | +| enable\_eval | Enables the eval command to run arbitrary code on the bot. | No | `ENABLE_EVAL = True` | +| github\_token | Needed to use the update command | No | `GITHUB_TOKEN = ghp_ABC132gfdsg4321fds` | +| disable\_autoupdates | Allows for auto updates | No | `DISABLE_AUTOUPDATES = True` | +| disable\_updates | Disables updates all together | No | `DISABLE_UPDATES = True` | +| log\_level | The type of information posted in the terminal, Default is `INFO` | No | `LOG_LEVEL = ERROR/WARNING/INFO/DEBUG/NOTSET` |