Skip to content

Commit 5f4dc42

Browse files
authored
Merge pull request #1491 from python-discord/fix/dmrelay
2 parents 07fb4ed + 2dd9fbd commit 5f4dc42

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

Diff for: bot/constants.py

-3
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,6 @@ class Channels(metaclass=YAMLGetter):
402402
python_events: int
403403
python_news: int
404404
reddit: int
405-
user_event_announcements: int
406405

407406
dev_contrib: int
408407
dev_core: int
@@ -414,7 +413,6 @@ class Channels(metaclass=YAMLGetter):
414413
cooldown: int
415414

416415
attachment_log: int
417-
dm_log: int
418416
message_log: int
419417
mod_log: int
420418
user_log: int
@@ -466,7 +464,6 @@ class Webhooks(metaclass=YAMLGetter):
466464

467465
big_brother: int
468466
dev_log: int
469-
dm_log: int
470467
duck_pond: int
471468
incidents_archive: int
472469
reddit: int

Diff for: bot/exts/moderation/dm_relay.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import logging
2-
import textwrap
32

43
import discord
54
from discord.ext.commands import Cog, Context, command, has_any_role
@@ -50,12 +49,17 @@ async def dmrelay(self, ctx: Context, user: discord.User, limit: int = 100) -> N
5049
await ctx.send(f"{Emojis.cross_mark} No direct message history with {user.mention}.")
5150
return
5251

53-
metadata = textwrap.dedent(f"""\
54-
User: {user} ({user.id})
55-
Channel ID: {user.dm_channel.id}\n
56-
""")
52+
metadata = (
53+
f"User: {user} ({user.id})\n"
54+
f"Channel ID: {user.dm_channel.id}\n\n"
55+
)
5756

5857
paste_link = await send_to_paste_service(metadata + output, extension="txt")
58+
59+
if paste_link is None:
60+
await ctx.send(f"{Emojis.cross_mark} Failed to upload output to hastebin.")
61+
return
62+
5963
await ctx.send(paste_link)
6064

6165
async def cog_check(self, ctx: Context) -> bool:

Diff for: config-default.yml

-5
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ guild:
150150
python_events: &PYEVENTS_CHANNEL 729674110270963822
151151
python_news: &PYNEWS_CHANNEL 704372456592506880
152152
reddit: &REDDIT_CHANNEL 458224812528238616
153-
user_event_announcements: &USER_EVENT_A 592000283102674944
154153

155154
# Development
156155
dev_contrib: &DEV_CONTRIB 635950537262759947
@@ -169,7 +168,6 @@ guild:
169168

170169
# Logs
171170
attachment_log: &ATTACH_LOG 649243850006855680
172-
dm_log: 653713721625018428
173171
message_log: &MESSAGE_LOG 467752170159079424
174172
mod_log: &MOD_LOG 282638479504965634
175173
user_log: 528976905546760203
@@ -287,7 +285,6 @@ guild:
287285
webhooks:
288286
big_brother: 569133704568373283
289287
dev_log: 680501655111729222
290-
dm_log: 654567640664244225
291288
duck_pond: 637821475327311927
292289
incidents_archive: 720671599790915702
293290
python_news: &PYNEWS_WEBHOOK 704381182279942324
@@ -324,7 +321,6 @@ filter:
324321
- *MOD_LOG
325322
- *STAFF_LOUNGE
326323
- *TALENT_POOL
327-
- *USER_EVENT_A
328324

329325
role_whitelist:
330326
- *ADMINS_ROLE
@@ -517,7 +513,6 @@ duck_pond:
517513
- *PYEVENTS_CHANNEL
518514
- *MAILING_LISTS
519515
- *REDDIT_CHANNEL
520-
- *USER_EVENT_A
521516
- *DUCK_POND
522517
- *CHANGE_LOG
523518
- *STAFF_ANNOUNCEMENTS

0 commit comments

Comments
 (0)