Skip to content

Commit db2762d

Browse files
committed
Merge branch 'master' into rewrite-config
2 parents 9556ef7 + 83ebd43 commit db2762d

File tree

5 files changed

+29
-25
lines changed

5 files changed

+29
-25
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,18 @@ Special thanks to our sponsors for supporting the project.
114114

115115
- [flyAurora](https://flyaurora.xyz/):
116116

117+
<a href='https://www.youtube.com/channel/UCgSmBJD9imASmJRleycTCwQ/featured'>
118+
<img height=150 src='https://i.imgur.com/WyzaPKY.png' style='margin:10'>
119+
</a>
120+
117121
<a href='https://flyaurora.xyz/'>
118122
<img height=150 src='https://pbs.twimg.com/profile_images/1142307497115443200/whbHhb9B_400x400.jpg'>
119123
</a>
120124
<br>
121125
<br>
122126

127+
128+
123129
Become a [sponsor](https://patreon.com/kyber).
124130

125131
## Plugins

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
@@ -126,7 +126,6 @@ async def setup(self, *, creator=None, category=None):
126126
log_url = log_count = None
127127
# ensure core functionality still works
128128

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

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

152151
# Once thread is ready, tell the recipient.
@@ -763,7 +762,13 @@ async def find(
763762
) -> Thread:
764763
"""Finds a thread from cache or from discord channel topics."""
765764
if recipient is None and channel is not None:
766-
return self._find_from_channel(channel)
765+
thread = self._find_from_channel(channel)
766+
if thread is None:
767+
id, thread = next(((k, v) for k, v in self.cache.items() if v.channel == channel), (-1, None))
768+
if thread is not None:
769+
logger.debug('Found thread with tempered ID.')
770+
await channel.edit(topic=f"User ID: {id}")
771+
return thread
767772

768773
thread = None
769774

core/utils.py

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

plugins/registry.json

Lines changed: 0 additions & 9 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",

0 commit comments

Comments
 (0)