Skip to content

Commit 3a9e23f

Browse files
pull[bot]fourjrJerrie-Ariesayamdobhallorenzo132
authored
[pull] master from kyb3r:master (#70)
* Sending files in threads (non-images) now work. resolves modmail-dev#2926 * Deleting messages no longer shows a false error, resolves modmail-dev#2910 * Linting * Fix `?perms get` command showing IDs instead of user or role mentions. * Support discord.py v1.6 & LOTTIE stickers * Release v3.8 * Linting & Changelog * Fix bug when sending multiple images at once. * Fix error when reacting on confirm thread creation message. * Update changelog * Autotriggers no longer sends attachments back. resolves modmail-dev#2932 * Fix `logs` command without argument in thread channel when the recipient is not cached. * Fix error raised when recipient is not cached and reacts to reactions in DM channel. * Fixed bug with update notifiations * Retry with diff name if channel cant be created resolves modmail-dev#2934 * Retrieve user from Discord API if user has left the server, modmail-dev#2935 modmail-dev#2936 * IDs in `<member>` commands work now. * update version in discord version error string * Hotfix: Corrupted data no longer saved to thread cache * Bump version * 3.8.4 - Another fix attempt * Improved cache saving methods * Ability to disable mention on thread creation. * Update thread move message in case `mention` was set to disable/None. * Formatting... * Apply suggestions from code review Co-authored-by: Jia Rong Yee <[email protected]> * Fix typo in 'config_help.json' (modmail-dev#2957) * Update README.md (modmail-dev#2955) fix a sentence which said to join the old deleted plugin server * Add msglink command to get DM message URLs. * Add DM channel ID to genesis message footer. * Amend typo and black formatting. * Improve messages * Changelog update * Non-master/development branch deployments no longer cause erros to be raised. * Update changelog * Fix bug where autotriggers are in dm context, resolve modmail-dev#2961 * Use the ID attribute of DM Channel. Originally used the channel instance by mistake, causing the `__str__` to be used instead of the intended ID. * Confirm thread creation when user opens a thread using react to contact. * Block new thread from react to contact when Modmail DM is disabled (new or all). * Bot will not attempt to find for linked message when the recipient reacts to reactions on confirm thread creation message. * Fix previous commit. * Fix a few bad refs and typos * Add local plugins * Add local plugin dir * Add local plugins * Updated version, deps, and plugins code * Forgot to finish sentence * new plugin A little plugin I was working on * Potentially breaking: improved plugin events * Fix bug where cancelled still attempts to start thread * Changelog & Ghost errors are no longer raised when threads are created using non-organic methods. * Add reaciton menu plugin * better run command, 3.9.1 * add music plugin added music plugin on taki's request * Update registry.json try to fix install issue * Update bot.py add hosting methods: screen and systemd * Update models.py add hosting methods: screen and systemd * Force update dev? Weird history * Add docker hostingmethod * Update config_help.json Change disabled to enabled, as it is enabled on a new bot creation * Bump versions * Update readme * did i not commit this * Update `mention` command. * Add Coolguy (Prime Servers) to SPONSORS * Small correction * Add Coolguy (Prime Servers) to SPONSORS * Update to HTTPS * Update to HTTPS * v3.9.3 add use_user_id_channel_name * black * Possibly fix emoji problem * Cleaner code :D * Bump python runtime version Security update * Update sponsors * Add docker-compose configuration for self hosting Adds a docker-compose configuration file for running both the bot and logviewer with a shared mongo database in a single container stack. Exposes port 8000 and ensure the mongo database can not be accessed remotely. * Change Max Channel per Category to 49, fix fallback save logic * There is now a proper message when trying to contact a bot. * Changelog - v3.9.4 * Fix typo * add fourjr claim * Add volume for persistent data storage to Mongo * Update pyproject.toml * Update README.md * Update sponsors * Fix typo in config help. * Update 'bot.py' and 'clients.py': - Fix return types, type hints, and unresolved references. * Update database after resetting/purging all plugins. * `plugin reset`, remove unloaded plugins from `self.loaded_plugins` * turn mentions into set * Hopefully resolves modmail-dev#3022. * Improve contact and react to contact: - Checks if user is blocked when `?contact` command or react to contact is used. * Remove publish plugin * Initial 3.9.5-dev1 * Update registry.json removal of profanity filter, trying to download will result in a infinite download loop and will stop any plugin from loading/break the usage of removing/adding new plugins * Group conversation ALPHA modmail-dev#143 * Remove debug * Push ver * Fix closes for group conversations * Bump version * Update registry.json * Changelog * Add solution to CERTIFICATE_VERIFY_FAILED * New issue forms * formatting * Update SPONSORS.json * fix issue template * Update requirements system and removed poetry * Sort pipfile * Remove flake8 from req, use new rec line-width of 110, black format * Remove flake8 from req, use new rec line-width of 110, black format * Add dnspython (pymongo[srv]) as req * Updates channel.move, bot.close, emoji changes * Keep more log files * Bump version * Black format * Updated sponsors * Improved dockerfile * Add restart and environment for bot * Update sponsors * Update modmail.py fix typo { modmail-dev#3067 } { https://usagi.xn--6frz82g/6DEshJ } * Formatting and final updates to deps * formatting * Fix SSL Error * Changelog * bump v * Fix failing Docker build * Fix UnicodeEncodeError on Windows. (modmail-dev#3043) * Fix UnionEncodeError on Windows when logging unicode emojis or special characters. * Formatting... * Plugins: add Python Discord's - **Case insensitive snippets**: Allow snippets to be ran even if with the wrong case. For example, `?Dm-RePort` will be recognized as `?dm-report`. - **Close message:** Add a `?closemessage` command that will close the thread after 15 minutes with a default message. - **MDLink**: Generate a ready to paste link to the thread logs. - **Reply cooldown**: Forbid you from sending the same message twice in ten seconds. - **Tagging**: Add a `?tag` command capable of adding a `$message|` header to the channel name. * Let snippets be invoked case-insensitively. * Update changelogs * Update changelog * Improved way to do case insensitive snippets * Update changelog and merge issues * Formatting * Fix contact with category and silent, modmail-dev#3076 * Resolve close_on_leave_reason not properly working * Invalid arguments are now properly catched and a proper error message is sent (BadUnionArg) * Removeuser (resolve modmail-dev#3065), silent adding/removing (modmail-dev#3054) * Formatting * add multiple users to a thread (resolve modmail-dev#3066), new group config options * Formatting * Fix formatter, allow add by roles (resolve modmail-dev#3053) * Remove tagging and case insensitive plugins * Changelog * Use highest hoisted role as default tag, resolves modmail-dev#3014 * Reload thread cache only when it's the first on_ready trigger. Resolves modmail-dev#3037 * Resolve linked messages issues, improve group functionality (bugfixes), resolves modmail-dev#3041 * Persistent notes are now properly deleted,resolve modmail-dev#3013 * Fix changelog formatting * Fix changelog formatting * Fix changelog formatting * New thread related config, resolves modmail-dev#3072 * Resolve issues with deleting messages * use_timestamp_channel_name config * formatting * add documentation and fix timestamp related bugs * Initial commit * Bug fixes and debug removal * Remove debug * Remove additional debug * Update bot.py * Edit error message * move format_channel_name to Bot, resolve modmail-dev#2982 * Formatting * bump ver * Bug fixes * Redo alias conversion * Remove redundant category checks * ?contact accepts multiple users, or role modmail-dev#3082 * Changelog and fix bot perm level * Remove extra loop.close * Push version to 3.10 * Quick bugfix on config help and debug hastebin * Fix bug where snippet add did not check command name * v3.10.1 - fix edit cmd * Fix contact * bump ver * oops * Add phish checker plugin * Added sponsor * Update SPONSORS.json * Update bandit baseline: * 3.10.3 contact fix Co-authored-by: Jia Rong Yee <[email protected]> Co-authored-by: Jerrie-Aries <[email protected]> Co-authored-by: Ayam Dobhal <[email protected]> Co-authored-by: lorenzo132 <[email protected]> Co-authored-by: scragly <[email protected]> Co-authored-by: Taku <[email protected]> Co-authored-by: ❥sora <[email protected]> Co-authored-by: Ralph <[email protected]> Co-authored-by: codeinteger6 <[email protected]> Co-authored-by: redstonedesigner <[email protected]> Co-authored-by: Stephen <[email protected]> Co-authored-by: Cyrus Yip <[email protected]> Co-authored-by: Cyrus <[email protected]> Co-authored-by: Matt Nikkel <[email protected]> Co-authored-by: Matteo Bertucci <[email protected]> Co-authored-by: Qwerty-133 <[email protected]> Co-authored-by: popeeyy <[email protected]> Co-authored-by: kato <[email protected]>
1 parent c778bd5 commit 3a9e23f

39 files changed

+3152
-1856
lines changed

.bandit_baseline.json

Lines changed: 41 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"errors": [],
3-
"generated_at": "2020-11-12T15:17:38Z",
3+
"generated_at": "2021-11-20T17:06:28Z",
44
"metrics": {
55
"./bot.py": {
66
"CONFIDENCE.HIGH": 1.0,
@@ -11,7 +11,7 @@
1111
"SEVERITY.LOW": 1.0,
1212
"SEVERITY.MEDIUM": 0.0,
1313
"SEVERITY.UNDEFINED": 0.0,
14-
"loc": 1264,
14+
"loc": 1406,
1515
"nosec": 0
1616
},
1717
"./cogs/modmail.py": {
@@ -23,7 +23,7 @@
2323
"SEVERITY.LOW": 0.0,
2424
"SEVERITY.MEDIUM": 0.0,
2525
"SEVERITY.UNDEFINED": 0.0,
26-
"loc": 1280,
26+
"loc": 1678,
2727
"nosec": 0
2828
},
2929
"./cogs/plugins.py": {
@@ -35,7 +35,7 @@
3535
"SEVERITY.LOW": 1.0,
3636
"SEVERITY.MEDIUM": 0.0,
3737
"SEVERITY.UNDEFINED": 0.0,
38-
"loc": 572,
38+
"loc": 597,
3939
"nosec": 0
4040
},
4141
"./cogs/utility.py": {
@@ -47,7 +47,7 @@
4747
"SEVERITY.LOW": 1.0,
4848
"SEVERITY.MEDIUM": 1.0,
4949
"SEVERITY.UNDEFINED": 0.0,
50-
"loc": 1710,
50+
"loc": 1768,
5151
"nosec": 0
5252
},
5353
"./core/_color_data.py": {
@@ -63,15 +63,15 @@
6363
"nosec": 0
6464
},
6565
"./core/changelog.py": {
66-
"CONFIDENCE.HIGH": 0.0,
66+
"CONFIDENCE.HIGH": 1.0,
6767
"CONFIDENCE.LOW": 0.0,
6868
"CONFIDENCE.MEDIUM": 0.0,
6969
"CONFIDENCE.UNDEFINED": 0.0,
7070
"SEVERITY.HIGH": 0.0,
71-
"SEVERITY.LOW": 0.0,
71+
"SEVERITY.LOW": 1.0,
7272
"SEVERITY.MEDIUM": 0.0,
7373
"SEVERITY.UNDEFINED": 0.0,
74-
"loc": 145,
74+
"loc": 159,
7575
"nosec": 0
7676
},
7777
"./core/checks.py": {
@@ -83,7 +83,7 @@
8383
"SEVERITY.LOW": 0.0,
8484
"SEVERITY.MEDIUM": 0.0,
8585
"SEVERITY.UNDEFINED": 0.0,
86-
"loc": 89,
86+
"loc": 105,
8787
"nosec": 0
8888
},
8989
"./core/clients.py": {
@@ -95,7 +95,7 @@
9595
"SEVERITY.LOW": 1.0,
9696
"SEVERITY.MEDIUM": 0.0,
9797
"SEVERITY.UNDEFINED": 0.0,
98-
"loc": 585,
98+
"loc": 598,
9999
"nosec": 0
100100
},
101101
"./core/config.py": {
@@ -107,7 +107,7 @@
107107
"SEVERITY.LOW": 0.0,
108108
"SEVERITY.MEDIUM": 0.0,
109109
"SEVERITY.UNDEFINED": 0.0,
110-
"loc": 327,
110+
"loc": 375,
111111
"nosec": 0
112112
},
113113
"./core/decorators.py": {
@@ -131,7 +131,7 @@
131131
"SEVERITY.LOW": 0.0,
132132
"SEVERITY.MEDIUM": 0.0,
133133
"SEVERITY.UNDEFINED": 0.0,
134-
"loc": 199,
134+
"loc": 204,
135135
"nosec": 0
136136
},
137137
"./core/paginator.py": {
@@ -155,7 +155,7 @@
155155
"SEVERITY.LOW": 0.0,
156156
"SEVERITY.MEDIUM": 0.0,
157157
"SEVERITY.UNDEFINED": 0.0,
158-
"loc": 993,
158+
"loc": 1097,
159159
"nosec": 0
160160
},
161161
"./core/time.py": {
@@ -167,7 +167,7 @@
167167
"SEVERITY.LOW": 0.0,
168168
"SEVERITY.MEDIUM": 0.0,
169169
"SEVERITY.UNDEFINED": 0.0,
170-
"loc": 158,
170+
"loc": 156,
171171
"nosec": 0
172172
},
173173
"./core/utils.py": {
@@ -179,32 +179,32 @@
179179
"SEVERITY.LOW": 0.0,
180180
"SEVERITY.MEDIUM": 0.0,
181181
"SEVERITY.UNDEFINED": 0.0,
182-
"loc": 283,
182+
"loc": 351,
183183
"nosec": 0
184184
},
185185
"_totals": {
186-
"CONFIDENCE.HIGH": 4.0,
186+
"CONFIDENCE.HIGH": 5.0,
187187
"CONFIDENCE.LOW": 0.0,
188188
"CONFIDENCE.MEDIUM": 1.0,
189189
"CONFIDENCE.UNDEFINED": 0.0,
190190
"SEVERITY.HIGH": 0.0,
191-
"SEVERITY.LOW": 4.0,
191+
"SEVERITY.LOW": 5.0,
192192
"SEVERITY.MEDIUM": 1.0,
193193
"SEVERITY.UNDEFINED": 0.0,
194-
"loc": 8989,
194+
"loc": 9878,
195195
"nosec": 0
196196
}
197197
},
198198
"results": [
199199
{
200-
"code": "11 from datetime import datetime\n12 from subprocess import PIPE\n13 from types import SimpleNamespace\n",
200+
"code": "13 from datetime import datetime\n14 from subprocess import PIPE\n15 from types import SimpleNamespace\n",
201201
"filename": "./bot.py",
202202
"issue_confidence": "HIGH",
203203
"issue_severity": "LOW",
204204
"issue_text": "Consider possible security implications associated with PIPE module.",
205-
"line_number": 12,
205+
"line_number": 14,
206206
"line_range": [
207-
12
207+
14
208208
],
209209
"more_info": "https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b404-import-subprocess",
210210
"test_id": "B404",
@@ -240,27 +240,42 @@
240240
"test_name": "blacklist"
241241
},
242242
{
243-
"code": "1985 try:\n1986 exec(to_compile, env) # pylint: disable=exec-used\n1987 except Exception as exc:\n",
243+
"code": "2061 try:\n2062 exec(to_compile, env) # pylint: disable=exec-used\n2063 except Exception as exc:\n",
244244
"filename": "./cogs/utility.py",
245245
"issue_confidence": "HIGH",
246246
"issue_severity": "MEDIUM",
247247
"issue_text": "Use of exec detected.",
248-
"line_number": 1986,
248+
"line_number": 2062,
249249
"line_range": [
250-
1986
250+
2062
251251
],
252252
"more_info": "https://bandit.readthedocs.io/en/latest/plugins/b102_exec_used.html",
253253
"test_id": "B102",
254254
"test_name": "exec_used"
255255
},
256256
{
257-
"code": "68 \n69 def __init__(self, bot, access_token: str = \"\", username: str = \"\", **kwargs):\n70 self.bot = bot\n71 self.session = bot.session\n72 self.headers: dict = None\n73 self.access_token = access_token\n74 self.username = username\n75 self.avatar_url: str = kwargs.pop(\"avatar_url\", \"\")\n76 self.url: str = kwargs.pop(\"url\", \"\")\n77 if self.access_token:\n78 self.headers = {\"Authorization\": \"token \" + str(access_token)}\n79 \n80 async def request(\n",
257+
"code": "2 import re\n3 from subprocess import PIPE\n4 from typing import List\n",
258+
"filename": "./core/changelog.py",
259+
"issue_confidence": "HIGH",
260+
"issue_severity": "LOW",
261+
"issue_text": "Consider possible security implications associated with PIPE module.",
262+
"line_number": 3,
263+
"line_range": [
264+
3
265+
],
266+
"more_info": "https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b404-import-subprocess",
267+
"test_id": "B404",
268+
"test_name": "blacklist"
269+
},
270+
{
271+
"code": "67 \n68 def __init__(self, bot, access_token: str = \"\", username: str = \"\", **kwargs):\n69 self.bot = bot\n70 self.session = bot.session\n71 self.headers: Optional[dict] = None\n72 self.access_token = access_token\n73 self.username = username\n74 self.avatar_url: str = kwargs.pop(\"avatar_url\", \"\")\n75 self.url: str = kwargs.pop(\"url\", \"\")\n76 if self.access_token:\n77 self.headers = {\"Authorization\": \"token \" + str(access_token)}\n78 \n79 @property\n80 def BRANCH(self):\n",
258272
"filename": "./core/clients.py",
259273
"issue_confidence": "MEDIUM",
260274
"issue_severity": "LOW",
261275
"issue_text": "Possible hardcoded password: ''",
262-
"line_number": 69,
276+
"line_number": 68,
263277
"line_range": [
278+
68,
264279
69,
265280
70,
266281
71,

.dockerignore

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -133,23 +133,18 @@ node_modules/
133133
config.json
134134
plugins/
135135
!plugins/registry.json
136+
!plugins/@local/
136137
temp/
137138
test.py
138139

139140
# Other stuff
140141
.env.example
141142
.gitignore
142-
.lint.py
143-
.pylintrc
144-
.travis.yml
143+
.github/
145144
app.json
146145
CHANGELOG.md
147-
CODE_OF_CONDUCT.md
148-
CONTRIBUTING.md
149-
requirements.min.txt
150146
Procfile
151147
pyproject.toml
152148
README.md
153-
runtime.txt
154-
SPONSORS.json
155-
stack.yml
149+
Pipfile
150+
Pipfile.lock

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Bug Report
2+
description: File a bug report
3+
title: "[BUG]: your bug report title"
4+
labels: "maybe: bug"
5+
body:
6+
- type: input
7+
id: bot-info-version
8+
attributes:
9+
label: Bot Version
10+
description: Check it with `@modmail about`
11+
placeholder: eg. v3.9.4
12+
validations:
13+
required: true
14+
- type: dropdown
15+
id: bot-info-hosting
16+
attributes:
17+
label: How are you hosting Modmail?
18+
description: You can check it with `@modmail about` if you are unsure
19+
options:
20+
- Heroku
21+
- Systemd
22+
- PM2
23+
- Patreon
24+
- Other
25+
validations:
26+
required: true
27+
- type: input
28+
id: logs
29+
attributes:
30+
label: Error Logs
31+
placeholder: https://hastebin.cc/placeholder
32+
description:
33+
"If your Modmail bot is online, type `@modmail debug hastebin` and include the link here.
34+
35+
If your Modmail bot is not online or the previous command did not generate a link, do the following:
36+
37+
1. Select your *bot* application at https://dashboard.heroku.com
38+
39+
2. [Restart your bot](https://i.imgur.com/3FcrlKz.png)
40+
41+
3. Reproduce the error to populate the error logs
42+
43+
4. [Copy and paste the logs](https://i.imgur.com/TTrhitm.png)"
44+
validations:
45+
required: true
46+
- type: textarea
47+
id: screenshots
48+
attributes:
49+
label: Screenshots
50+
description: "[optional] You may add screenshots to further explain your problem."
51+
- type: textarea
52+
id: additional-info
53+
attributes:
54+
label: Additional Information
55+
description: "[optional] You may provide additional context for us to better understand how this issue occured."

.github/ISSUE_TEMPLATE/command-request.md

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Discord Server
4+
url: https://discord.gg/etJNHCQ
5+
about: Please ask hosting-related questions here before creating an issue.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)