Skip to content

Commit 586275d

Browse files
committed
Merge branch 'master' of https://github.com/verixx/modmail
2 parents 9e15f68 + fce6de8 commit 586275d

File tree

5 files changed

+39
-26
lines changed

5 files changed

+39
-26
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,16 @@ You can also set up autoupdates. To do this, [install the Pull app in your fork]
9595

9696
Sepcial thanks to our sponsors for supporting the project.
9797

98+
<a href='https://www.youtube.com/channel/UCgSmBJD9imASmJRleycTCwQ/featured'>
99+
<img height=150 src='https://i.imgur.com/WyzaPKY.png' style='margin:10'>
100+
</a>
101+
98102
<a href='https://flyaurora.xyz/'>
99103
<img height=150 src='https://pbs.twimg.com/profile_images/1142307497115443200/whbHhb9B_400x400.jpg'>
100104
</a>
101105

106+
107+
102108
Become a [sponsor](https://patreon.com/kyber).
103109

104110

SPONSORS.json

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
[{
22
"embed": {
3-
"title": "You can have a custom page for yourself here.",
4-
"description": "Generate your own embed from [here](https://leovoel.github.io/embed-visualizer/) and make a pull request editing the `SPONSORS.json` file on [GitHub](https://github.com/kyb3r/modmail/blob/master/SPONSORS.json).",
5-
"url": "https://patreon.com/kyber",
6-
"color": 6071775,
3+
"description": "This is a youtube channel that provides high quality reddit content. Videos are uploaded regularly so you are never out of funny, interesting or even creepy content!",
4+
"color": 15114050,
75
"footer": {
8-
"icon_url": "https://vignette.wikia.nocookie.net/smashtopia/images/c/c9/Insert_Image_Here.jpg/revision/latest?cb=20170827054712",
9-
"text": "footer text"
6+
"icon_url": "https://i.imgur.com/fvNKUks.png",
7+
"text": "I am a robot, son of Daniel (UK)"
108
},
119
"thumbnail": {
12-
"url": "https://vignette.wikia.nocookie.net/smashtopia/images/c/c9/Insert_Image_Here.jpg/revision/latest?cb=20170827054712"
10+
"url": "https://i.imgur.com/WyzaPKY.png"
1311
},
1412
"author": {
15-
"name": "Nothing here yet!",
16-
"url": "https://patreon.com/kyber",
17-
"icon_url": "https://vignette.wikia.nocookie.net/smashtopia/images/c/c9/Insert_Image_Here.jpg/revision/latest?cb=20170827054712"
13+
"name": "Sir Reddit",
14+
"url": "https://www.youtube.com/channel/UCgSmBJD9imASmJRleycTCwQ?sub_confirmation=1",
15+
"icon_url": "https://i.imgur.com/WyzaPKY.png"
1816
},
1917
"fields": [
2018
{
21-
"name": "🤔",
22-
"value": "This command lists the sponsors of this project on [**Patreon**](https://patreon.com/kyber)"
19+
"name": "Subscribe!",
20+
"value": "[**Click Here**](https://www.youtube.com/channel/UCgSmBJD9imASmJRleycTCwQ?sub_confirmation=1)"
21+
},
22+
{
23+
"name": "Discord Server!",
24+
"value": "[**Click Here**](https://discord.gg/s8Ddphx)"
2325
}
2426
]
2527
}

core/thread.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ async def setup(self, *, creator=None, category=None):
127127
log_url = log_count = None
128128
# ensure core functionality still works
129129

130-
topic = f"User ID: {recipient.id}"
131130
if creator:
132131
mention = None
133132
else:
@@ -147,7 +146,7 @@ async def send_genesis_message():
147146
self.ready = True
148147
self.bot.dispatch("thread_ready", self)
149148

150-
await channel.edit(topic=topic)
149+
await channel.edit(topic=f"User ID: {recipient.id}")
151150
self.bot.loop.create_task(send_genesis_message())
152151

153152
# Once thread is ready, tell the recipient.
@@ -735,7 +734,13 @@ async def find(
735734
) -> Thread:
736735
"""Finds a thread from cache or from discord channel topics."""
737736
if recipient is None and channel is not None:
738-
return self._find_from_channel(channel)
737+
thread = self._find_from_channel(channel)
738+
if thread is None:
739+
id, thread = next(((k, v) for k, v in self.cache.items() if v.channel == channel), (-1, None))
740+
if thread is not None:
741+
logger.debug('Found thread with tempered ID.')
742+
await channel.edit(topic=f"User ID: {id}")
743+
return thread
739744

740745
thread = None
741746

core/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def match_user_id(text: str) -> int:
188188
int
189189
The user ID if found. Otherwise, -1.
190190
"""
191-
match = re.match(r"^User ID: (\d+)$", text)
191+
match = re.search(r"\bUser ID: (\d+)\b", text)
192192
if match is not None:
193193
return int(match.group(1))
194194
return -1

plugins/registry.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,6 @@
107107
"icon_url": "https://images.ionadev.ml/b/ZIDUUsl.png",
108108
"thumbnail_url": "https://images.ionadev.ml/b/ZIDUUsl.png"
109109
},
110-
"moderation": {
111-
"repository": "officialpiyush/modmail-plugins",
112-
"branch": "master",
113-
"description": "Rule offenders in your server? Lift the ban hammer or warn them! Moderation plugin to the rescue :tada:",
114-
"bot_version": "2.20.1",
115-
"title": "Moderation Plugin",
116-
"icon_url": "https://images.ionadev.ml/b/ZIDUUsl.png",
117-
"thumbnail_url": "https://images.ionadev.ml/b/ZIDUUsl.png"
118-
},
119110
"translator": {
120111
"repository": "officialpiyush/modmail-plugins",
121112
"branch": "master",
@@ -187,5 +178,14 @@
187178
"title": "Get Stats",
188179
"icon_url": "https://image.flaticon.com/icons/png/512/117/117761.png",
189180
"thumbnail_url": "http://www.pngmart.com/files/7/Statistics-PNG-Clipart.png"
190-
}
181+
},
182+
"moderation": {
183+
"repository": "xPolar/modmail-plugins",
184+
"branch": "master",
185+
"description": "Moderate your server with Modmail, bring the Mod to Modmail!",
186+
"bot_version": "3.0.3",
187+
"title": "Moderate your server",
188+
"icon_url": "https://cdn.discordapp.com/attachments/539943767562780704/601485194196680704/wGFmzZq.png",
189+
"thumbnail_url": "https://cdn.discordapp.com/attachments/539943767562780704/601485194196680704/wGFmzZq.png"
190+
}
191191
}

0 commit comments

Comments
 (0)