Skip to content

Commit b1ee0a5

Browse files
committed
Merge from Master
2 parents e8eff73 + 5321915 commit b1ee0a5

File tree

3 files changed

+53
-24
lines changed

3 files changed

+53
-24
lines changed

README.md

Lines changed: 46 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div align="center">
22
<img src="https://i.imgur.com/o558Qnq.png" align="center">
33
<br>
4-
<strong><i>A simple and functional Modmail bot for Discord.</i></strong>
4+
<strong><i>A feature rich Modmail bot for Discord.</i></strong>
55
<br>
66
<br>
77

@@ -25,31 +25,59 @@
2525
</div>
2626

2727

28-
## How Does Modmail Work?
29-
30-
<img src="https://i.imgur.com/GGukNDs.png" align="right" height="350">
31-
32-
When a user sends a direct message to the bot, a channel is created within an isolated category. This channel is where messages will be relayed. To reply to the message, simply use the command `?reply` in the channel. A full list of commands can be found in the [wiki](https://github.com/kyb3r/modmail/wiki) or by using the `?help` command.
28+
## What is Modmail?
29+
30+
Modmail's core functionality provides an efficient communications interface between server members and staff. When a member sends a direct message to the bot, a channel is created within an isolated category for that member. This channel is where messages will be relayed and where any available staff member can respond to that user.
31+
32+
## Features
33+
34+
* **Highly Customisable**
35+
* Bot activity, prefix, category, log channel, etc.
36+
* Fully customisable command permission system.
37+
* Interface elements (color, responses, reactions, etc.)
38+
* Snippets and *command aliases*
39+
* Minimum account/guild age in order to create a thread.
40+
* **Thread logs**
41+
* When you close a thread, a [log link](https://logs.modmail.tk/example) is generated and posted to your log channel.
42+
* Rendered in styled HTML like Discord.
43+
* Optional login in via Discord to protect your logs.
44+
* See past logs of a user with `?logs`
45+
* Searchable by text queries using `?logs search`
46+
* **Robust implementation**
47+
* Scheduled tasks in human time, e.g. `?close in 2 hours silently`.
48+
* Editing and deleting messages is synced on both ends.
49+
* Support for the full range of message content (mutliple images, files).
50+
* Paginated commands interfaces via reactions.
51+
52+
This list is ever growing thanks to active development and our exceptional contributors. See a full list of documented commands by using the `help` command.
3353

3454
## Installation
3555

36-
Currently, the easiest and fastest way to set up the bot is by using Heroku, which is a service that offers a free plan for hosting applications. If you choose to install the bot using Heroku, you will not need to download anything. The [**installation guide**](https://github.com/kyb3r/modmail/wiki/Installation) will guide you through the entire installation process. If you run into any problems, join our [Discord server](https://discord.gg/etJNHCQ) for help and support. Even if you don't have any issues, you should come and check out our awesome Discord community! :wink:
37-
38-
Interactive installation: [**https://taaku18.github.io/modmail/installation**](https://taaku18.github.io/modmail/installation)
39-
40-
41-
# Notable Features
56+
### Heroku
57+
Currently, the easiest way to set up the bot is by using Heroku, a container-based cloud platform. Installation via Heroku is done in your web browser and keeps the bot online 24/7 for free. The [**installation guide**](https://github.com/kyb3r/modmail/wiki/Installation) will guide you through the entire installation process. If you run into any problems, join the [development server](https://discord.gg/etJNHCQ) for help and support.
4258

43-
## Customizability
59+
### Locally
60+
Installation locally for development reasons or otherwise is as follows, you will need `python 3.7`.
4461

45-
Modmail has a range of configuration variables that you can dynamically alter with the `?config` command. You can use them to change the different aspects of the bot, for example, the embed color, responses, reactions, status, etc. Snippets and custom command aliases are also supported. The level of customization is ever growing thanks to our exceptional contributors.
62+
Clone the repo
63+
```console
64+
$ git clone https://github.com/kyb3r/modmail
65+
$ cd modmail
66+
```
4667

47-
## Thread Logs
68+
Install dependancies
69+
```console
70+
$ pip install -r requirements.txt
71+
```
4872

49-
Thread conversations are automatically logged with a generated viewable website of the complete thread. Logs are rendered with styled HTML and presented in an aesthetically pleasing way—it blends seamlessly with the mobile version of Discord. You have the ability to query and search through logs using the bot via commands. An example of a logged conversation: https://logs.modmail.tk/example.
73+
Rename the `config.json.example` to `config.json` and fill out the fields.
74+
And finally, run the bot.
75+
```console
76+
$ python3 bot.py
77+
```
5078

51-
# Contributing
79+
## Contributing
5280

5381
This project is licenced under MIT. If you have any new ideas, create an issue or a pull request. Contributions to Modmail are always welcome, whether it be improvements to the documentation or new functionality, please feel free make the change.
5482

55-
If you use Modmail and love it, consider supporting me on **[Patreon](https://www.patreon.com/kyber)** :heart:
83+
If you use Modmail and love it, consider becoming a patron on **[Patreon](https://www.patreon.com/kyber)** :smile:

cogs/modmail.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ async def logs_search(self, ctx, limit: Optional[int] = None, *, query):
510510
@commands.command()
511511
@checks.has_permissions(PermissionLevel.SUPPORTER)
512512
@checks.thread_only()
513-
async def reply(self, ctx, *, msg: str):
513+
async def reply(self, ctx, *, msg: str = ''):
514514
"""Reply to users using this command.
515515
516516
Supports attachments and images as well as
@@ -523,7 +523,7 @@ async def reply(self, ctx, *, msg: str):
523523
@commands.command()
524524
@checks.has_permissions(PermissionLevel.SUPPORTER)
525525
@checks.thread_only()
526-
async def anonreply(self, ctx, *, msg: str):
526+
async def anonreply(self, ctx, *, msg: str = ''):
527527
"""Reply to a thread anonymously.
528528
529529
You can edit the anonymous user's name,
@@ -539,7 +539,7 @@ async def anonreply(self, ctx, *, msg: str):
539539
@commands.command()
540540
@checks.has_permissions(PermissionLevel.SUPPORTER)
541541
@checks.thread_only()
542-
async def note(self, ctx, *, msg: str):
542+
async def note(self, ctx, *, msg: str = ''):
543543
"""Take a note about the current thread, useful for noting context."""
544544
ctx.message.content = msg
545545
async with ctx.typing():

core/thread.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
import os
55
import string
66
import typing
7+
from types import SimpleNamespace as param
78
from datetime import datetime, timedelta
89

910
import discord
10-
from discord.ext.commands import UserInputError, CommandError
11+
from discord.ext.commands import MissingRequiredArgument, CommandError
1112

1213
from core.models import Bot, ThreadManagerABC, ThreadABC
1314
from core.utils import is_image_url, days, match_user_id
@@ -349,7 +350,7 @@ async def delete_message(self, message_id):
349350

350351
async def note(self, message):
351352
if not message.content and not message.attachments:
352-
raise UserInputError
353+
raise MissingRequiredArgument(param(name='msg'))
353354

354355
await asyncio.gather(
355356
self.bot.api.append_log(message,
@@ -360,7 +361,7 @@ async def note(self, message):
360361

361362
async def reply(self, message, anonymous=False):
362363
if not message.content and not message.attachments:
363-
raise UserInputError
364+
raise MissingRequiredArgument(param(name='msg'))
364365
if all(not g.get_member(self.id) for g in self.bot.guilds):
365366
return await message.channel.send(
366367
embed=discord.Embed(

0 commit comments

Comments
 (0)