Skip to content

Modmail API Integration #82

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 75 commits into from
Jan 3, 2019
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
149ff1c
Use modmail.tk api for actions
kyb3r Dec 31, 2018
c3d1c75
Big
kyb3r Dec 31, 2018
d558c22
Stability improvements using asyncio Events
kyb3r Dec 31, 2018
7456f4f
Switch to production api url
kyb3r Jan 2, 2019
f6bb2e7
Refactor thread management
kyb3r Jan 2, 2019
489aad5
Refactor code to use new thread classes
kyb3r Jan 2, 2019
39d2e59
Refactor code to use new thread classes
kyb3r Jan 2, 2019
a314eab
Populate thread cache on bot ready
kyb3r Jan 2, 2019
273e795
wait until thread is ready internally
kyb3r Jan 2, 2019
e799811
Set thread to ready by default
kyb3r Jan 2, 2019
682d9e6
Move decorators to seperate file
kyb3r Jan 2, 2019
4c3f717
Move decorators to seperate file
kyb3r Jan 2, 2019
09bfc6b
Rename to core
kyb3r Jan 2, 2019
c2f4cb4
Seperate commands into cogs
kyb3r Jan 2, 2019
462cd98
Dynamic help and config resolves #84
kyb3r Jan 3, 2019
e4281da
Add python-box as a requirement
kyb3r Jan 3, 2019
47f72e7
Added dynamic snippet configuration.
kyb3r Jan 3, 2019
d838269
Added dynamic alias configuration resolves #86
kyb3r Jan 3, 2019
b31590a
Update new commands list
kyb3r Jan 3, 2019
f7cf9d3
Support alias arguments
kyb3r Jan 3, 2019
04a2cc5
Use the dominant colour of a user avatar for info embed
kyb3r Jan 3, 2019
3faff2a
Add an asyncexecutor decorator
kyb3r Jan 3, 2019
f49efbf
Use author url to store linked_message_ids
kyb3r Jan 3, 2019
4e6e13b
Add a move thread command
kyb3r Jan 3, 2019
2c09bc6
Add edit cmd docs
kyb3r Jan 3, 2019
b4b7778
Add support for an optional second guild resolves #81
kyb3r Jan 3, 2019
1f84f39
Add autoupdate functionality
kyb3r Jan 3, 2019
0f1507f
punctuation
kyb3r Jan 3, 2019
9662454
Fix auto updates
kyb3r Jan 3, 2019
df28635
Update app.json
kyb3r Jan 3, 2019
a7e2cdf
Fix typo
kyb3r Jan 3, 2019
f5dc6a1
Fix color code
fourjr Jan 3, 2019
8065f71
Docs
kyb3r Jan 3, 2019
30d55ca
Enable autoupdates by default
kyb3r Jan 3, 2019
367356a
Merge branch 'modmail-api' of https://github.com/verixx/modmail into …
kyb3r Jan 3, 2019
8aa01f4
Update modmail.py
kyb3r Jan 3, 2019
a7e7ea0
use single quotes
fourjr Jan 3, 2019
790c0be
Add user id next to mention
fourjr Jan 3, 2019
714cffb
Remove colon
fourjr Jan 3, 2019
bc9a561
single quotes
fourjr Jan 3, 2019
4bbb7f6
Check if the reaction message is the same as base message
kyb3r Jan 3, 2019
d98a1df
Merge branch 'modmail-api' of https://github.com/verixx/modmail into …
kyb3r Jan 3, 2019
9d4264b
use python 3.7
kyb3r Jan 3, 2019
78ce754
flake8 and change copyright year
fourjr Jan 3, 2019
594e0ff
Merge
fourjr Jan 3, 2019
aed7f3f
Merge branch 'modmail-api' of https://github.com/kyb3r/modmail into m…
fourjr Jan 3, 2019
e6396b4
Use python3.7
kyb3r Jan 3, 2019
1a58b4c
Merge branch 'modmail-api' of https://github.com/verixx/modmail into …
kyb3r Jan 3, 2019
2d524aa
Fix formatting
fourjr Jan 3, 2019
935d897
Update cogs/modmail.py
fourjr Jan 3, 2019
66592e2
Refresh config before setting status
kyb3r Jan 3, 2019
6c7df8b
Add a changelog, resolves #89
kyb3r Jan 3, 2019
6fde9bd
Merge branch 'modmail-api' of https://github.com/verixx/modmail into …
kyb3r Jan 3, 2019
f87dc15
Pin the info embed
kyb3r Jan 3, 2019
19bbf25
flakin
fourjr Jan 3, 2019
f21c241
Delete pin message
kyb3r Jan 3, 2019
f8311f4
Merge branch 'modmail-api' of https://github.com/verixx/modmail into …
kyb3r Jan 3, 2019
2368afc
Fix typo
kyb3r Jan 3, 2019
91511b0
Fix nsfw command
kyb3r Jan 3, 2019
23f1c4e
Fix logs command
kyb3r Jan 3, 2019
9a93600
Update modmail.py
kyb3r Jan 3, 2019
ed077b8
Fix indentation error
kyb3r Jan 3, 2019
40f4022
use typing.Union for member converter
kyb3r Jan 3, 2019
7a2174c
Update changelog
kyb3r Jan 3, 2019
2fc90b8
DOnt send the user a notifying message when contacting
kyb3r Jan 3, 2019
066e733
Dont send a log message if already up to date
kyb3r Jan 3, 2019
4dc8e54
Fix logs cmd
kyb3r Jan 3, 2019
da84ebf
Fixed blocking users
kyb3r Jan 3, 2019
e8fb2fd
Remove finding user id from channel history
kyb3r Jan 3, 2019
2383acb
STop spamming api
kyb3r Jan 3, 2019
1e72afd
Update modmail.py
kyb3r Jan 3, 2019
697152b
Fix paginator reaction check
kyb3r Jan 3, 2019
c2ff703
Update linked message edit to use new format
kyb3r Jan 3, 2019
7805b0b
Temp remove bug
kyb3r Jan 3, 2019
d8ee01f
Update README.md
kyb3r Jan 3, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 36 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@

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

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`.

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.
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).

## What it looks like

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

## Commands

| Name | Description |
|--------------|----------------------------------------------------------------------|
| setup | Sets up the categories that will be used by the bot. |
| about | Shows some general information about the bot. |
| contact | Allows a moderator to initiate a thread with a given recipient. |
| reply | Sends a message to the current thread's recipient. |
| close | Closes the current thread and deletes the channel. |
| archive | Closes the thread and moves the channel to the archive category. |
| block | Blocks a user from using modmail |
| blocked | Shows a list of users that are currently blocked |
| unblock | Unblocks a user from using modmail |
| snippets | Shows a list of snippets that are currently configured. |
| customstatus | Sets the bot playing status to a message of your choosin |
| disable | Closes all threads and disables modmail for the server. |
| update | Checks for new versions and updates the bot, follow the [updating guide](https://github.com/kyb3r/modmail/wiki/Updating) to use this command. |
### Modmail related

| Name | Command |
|----------|------------------------------------------------------------|
| setup | Sets up a server for modmail |
| reply | Reply to users using this command. |
| edit | Edit a message that was sent using the reply command. |
| contact | Create a thread with a specified member. |
| close | Close the current thread. |
| move | Moves the thread channel to a specified category |
| logs | Shows a list of previous modmail thread logs of a member. |
| block | Block a user from using modmail. |
| blocked | Returns a list of blocked users |
| unblock | Unblocks a user from using modmail. |
| nsfw | Flags a modmail thread as nsfw. |
| snippets | Returns a list of snippets that are currently set. |
| mention | Changes what the bot mentions at the start of each thread. |

### Utility commands
| Name | Command |
|----------|------------------------------------------------------------|
| help | Shows the help message. |
| update | Checks for new versions and updates the bot |
| github | Shows the github user your modmail api token is linked to. |
| prefix | Changes the prefix for the bot. |
| alias | Returns a list of aliases that are currently set. |
| about | Shows information about the bot. |
| status | Set a custom playing status for the bot. |
| ping | Pong! Returns your websocket latency. |
| eval | Evaluates python code (Bot owner only) |
| config | Manually change configuration for the bot. |

## Features

Expand All @@ -73,11 +87,11 @@ Snippets are shortcuts for predefined messages that you can send. You can add sn
### Custom Mentions
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.

### Thread Logs
Thread conversations are automatically logged and a log link (logs.modmail.tk) is provided with each thread.

### Delete Linked Messages
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!

## Thanks For Using This Bot!

If you do use the bot, a star on this repository is appreciated!

## Contributing
This project is licenced under MIT. Feel free to contribute to the development of this bot.
8 changes: 4 additions & 4 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"required": true
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we are moving over to Github tokens and OAuth, shouldn't app.json be removed?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This provides a streamlined interface for deploying a new app.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but this allows them to create Heroku apps without linking to Github which screws up with some commands

},
"PREFIX": {
"description": "Command prefix to use.",
"description": "Command prefix to use, default is `?`",
"required": false
},
"STATUS": {
Expand All @@ -27,9 +27,9 @@
"description": "Comma seperated user IDs of people that are allowed to use owner only commands. (eval and update)",
"required": false
},
"GITHUB_ACCESS_TOKEN": {
"description": "Github personal access token to enable use of the update command.",
"required": false
"MODMAIL_API_TOKEN": {
"description": "Api token from https://dashboard.modmail.tk",
"required": true
}
}
}
Loading