Skip to content

Commit 18b4880

Browse files
authored
Merge pull request #82 from kyb3r/modmail-api
Modmail API Integration
2 parents fd806bc + d8ee01f commit 18b4880

15 files changed

+1836
-1102
lines changed

CHANGELOG.md

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
# v2.0.0
8+
9+
This release introduces the use of our centralized [API service](https://github.com/kyb3r/webserver) to enable dynamic configuration, auto-updates, and thread logs. To use this release you must acquire an API token from https://modmail.tk. Read the updated installation guide [here](https://github.com/kyb3r/modmail/wiki/installation).
10+
11+
### Changed
12+
- Stability improvements through synchronization primitives
13+
- Refactor thread management and code
14+
- Update command now uses `api.modmail.tk`
15+
- Removed `archive` command
16+
- Explanation: With thread logs (that lasts forever), there's no point in archiving.
17+
- `contact` command no longer tells the user you messaged them 👻
18+
19+
### Fixed
20+
- Status command now changes playing status indefinitely
21+
22+
### Added
23+
- Dynamic help command (#84)
24+
- Dynamic configuration through `api.modmail.tk`
25+
- Thread logs via `logs.modmail.tk` (#78)
26+
- `log` command added
27+
- Automatic updates (#73)
28+
- Dynamic command aliases and snippets (#86)
29+
- Optional support for using a seperate guild as the operations center (#81)
30+
- NSFW Command to change channels to NSFW (#77)

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2017 kyb3r
3+
Copyright (c) 2017-2019 kyb3r
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+38-21
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@
2929

3030
<img src='https://i.imgur.com/aHtn4C5.png' align='right' height=140>
3131

32-
Assuming you got the bot setup (Read below on how to set it up), the first thing that you would do is type the command ```<prefix>setup [modrole]``` where `[modrole]` is an optional role you can specify which determines who can see the relayed messages. If a role is not specified, the bot will choose the first role that has `manage guild` permissions as the modrole. The bot will then set up a channel category named `Mod Mail`.
33-
34-
When a user sends a direct message to the bot, a channel is created within this new category. This channel is where messages will be relayed. To reply to a message, simply type the command `<prefix>reply <message>` in the channel.
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 a message, simply use the command `reply` in the channel. See a full list of commands [below](#commands).
3533

3634
## What it looks like
3735

@@ -49,21 +47,37 @@ If you are keen to stay updated with the latest features then follow the updatin
4947

5048
## Commands
5149

52-
| Name | Description |
53-
|--------------|----------------------------------------------------------------------|
54-
| setup | Sets up the categories that will be used by the bot. |
55-
| about | Shows some general information about the bot. |
56-
| contact | Allows a moderator to initiate a thread with a given recipient. |
57-
| reply | Sends a message to the current thread's recipient. |
58-
| close | Closes the current thread and deletes the channel. |
59-
| archive | Closes the thread and moves the channel to the archive category. |
60-
| block | Blocks a user from using modmail |
61-
| blocked | Shows a list of users that are currently blocked |
62-
| unblock | Unblocks a user from using modmail |
63-
| snippets | Shows a list of snippets that are currently configured. |
64-
| customstatus | Sets the bot playing status to a message of your choosin |
65-
| disable | Closes all threads and disables modmail for the server. |
66-
| update | Checks for new versions and updates the bot, follow the [updating guide](https://github.com/kyb3r/modmail/wiki/Updating) to use this command. |
50+
### Modmail related
51+
52+
| Name | Command |
53+
|----------|------------------------------------------------------------|
54+
| setup | Sets up a server for modmail |
55+
| reply | Reply to users using this command. |
56+
| edit | Edit a message that was sent using the reply command. |
57+
| contact | Create a thread with a specified member. |
58+
| close | Close the current thread. |
59+
| move | Moves the thread channel to a specified category |
60+
| logs | Shows a list of previous modmail thread logs of a member. |
61+
| block | Block a user from using modmail. |
62+
| blocked | Returns a list of blocked users |
63+
| unblock | Unblocks a user from using modmail. |
64+
| nsfw | Flags a modmail thread as nsfw. |
65+
| snippets | Returns a list of snippets that are currently set. |
66+
| mention | Changes what the bot mentions at the start of each thread. |
67+
68+
### Utility commands
69+
| Name | Command |
70+
|----------|------------------------------------------------------------|
71+
| help | Shows the help message. |
72+
| update | Checks for new versions and updates the bot |
73+
| github | Shows the github user your modmail api token is linked to. |
74+
| prefix | Changes the prefix for the bot. |
75+
| alias | Returns a list of aliases that are currently set. |
76+
| about | Shows information about the bot. |
77+
| status | Set a custom playing status for the bot. |
78+
| ping | Pong! Returns your websocket latency. |
79+
| eval | Evaluates python code (Bot owner only) |
80+
| config | Manually change configuration for the bot. |
6781

6882
## Features
6983

@@ -74,10 +88,13 @@ Snippets are shortcuts for predefined messages that you can send. You can add sn
7488
If you want the bot to mention a specific role instead of `@here`, you need to set a config variable `MENTION` and set the value to the mention of the role or user you want mentioned. To get the mention of a role or user, type `\@role` in chat and you will see something like `<@&515651147516608512>` use this string as the value for the config variable.
7589

7690
### Delete Linked Messages
77-
Did you accidentally send something you didnt mean to with the `reply` command? Dont fret, if you delete the original message on your side, this bot automatically deletes the corresponding message that was sent to the recipient of the thread!
91+
Did you accidentally send something you didnt mean to with the `reply` command? Dont fret, if you delete the original message on your side, this bot automatically deletes the corresponding message that was sent to the recipient of the thread! This also works with message edits in reverse.
7892

79-
## Thanks For Using This Bot!
93+
### Thread Logs
94+
Thread conversations are automatically logged and a log link (logs.modmail.tk) is provided with each thread.
8095

81-
If you do use the bot, a star on this repository is appreciated!
96+
### Automatic Updates
97+
The bot checks for new updates every hour and automatically updates to a newer version if found. You can disable this functionality by adding a `disable_autoupdates` config variable.
8298

99+
## Contributing
83100
This project is licenced under MIT. Feel free to contribute to the development of this bot.

app.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"required": true
1313
},
1414
"PREFIX": {
15-
"description": "Command prefix to use.",
15+
"description": "Command prefix to use, default is `?`",
1616
"required": false
1717
},
1818
"STATUS": {
@@ -27,9 +27,9 @@
2727
"description": "Comma seperated user IDs of people that are allowed to use owner only commands. (eval and update)",
2828
"required": false
2929
},
30-
"GITHUB_ACCESS_TOKEN": {
31-
"description": "Github personal access token to enable use of the update command.",
32-
"required": false
30+
"MODMAIL_API_TOKEN": {
31+
"description": "API token from https://modmail.tk",
32+
"required": true
3333
}
3434
}
35-
}
35+
}

0 commit comments

Comments
 (0)