From b030711b69a50c2b2c068865b1987d61f8267f1c Mon Sep 17 00:00:00 2001 From: Den4200 Date: Tue, 30 Mar 2021 15:58:05 -0400 Subject: Remove `dm_log` from channels and webhooks in the config. --- bot/constants.py | 2 -- config-default.yml | 2 -- 2 files changed, 4 deletions(-) diff --git a/bot/constants.py b/bot/constants.py index 467a4a2c4..4040d757e 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -414,7 +414,6 @@ class Channels(metaclass=YAMLGetter): cooldown: int attachment_log: int - dm_log: int message_log: int mod_log: int user_log: int @@ -466,7 +465,6 @@ class Webhooks(metaclass=YAMLGetter): big_brother: int dev_log: int - dm_log: int duck_pond: int incidents_archive: int reddit: int diff --git a/config-default.yml b/config-default.yml index 4e7060ea4..39b33ca10 100644 --- a/config-default.yml +++ b/config-default.yml @@ -169,7 +169,6 @@ guild: # Logs attachment_log: &ATTACH_LOG 649243850006855680 - dm_log: 653713721625018428 message_log: &MESSAGE_LOG 467752170159079424 mod_log: &MOD_LOG 282638479504965634 user_log: 528976905546760203 @@ -287,7 +286,6 @@ guild: webhooks: big_brother: 569133704568373283 dev_log: 680501655111729222 - dm_log: 654567640664244225 duck_pond: 637821475327311927 incidents_archive: 720671599790915702 python_news: &PYNEWS_WEBHOOK 704381182279942324 -- cgit v1.2.3 From d77af18516a030dd039014e2fcf5bb56e09e8358 Mon Sep 17 00:00:00 2001 From: Den4200 Date: Tue, 30 Mar 2021 16:00:21 -0400 Subject: Replace usage of `textwrap.dedent` with a cleaner method. --- bot/exts/moderation/dm_relay.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bot/exts/moderation/dm_relay.py b/bot/exts/moderation/dm_relay.py index a03230b3d..68a48c67c 100644 --- a/bot/exts/moderation/dm_relay.py +++ b/bot/exts/moderation/dm_relay.py @@ -1,5 +1,4 @@ import logging -import textwrap import discord from discord.ext.commands import Cog, Context, command, has_any_role @@ -50,10 +49,10 @@ class DMRelay(Cog): await ctx.send(f"{Emojis.cross_mark} No direct message history with {user.mention}.") return - metadata = textwrap.dedent(f"""\ - User: {user} ({user.id}) - Channel ID: {user.dm_channel.id}\n - """) + metadata = ( + f"User: {user} ({user.id})\n" + f"Channel ID: {user.dm_channel.id}\n\n" + ) paste_link = await send_to_paste_service(metadata + output, extension="txt") await ctx.send(paste_link) -- cgit v1.2.3 From 2334c95d8781df829ac2ec1a1c5abb2b4d776586 Mon Sep 17 00:00:00 2001 From: Den4200 Date: Tue, 30 Mar 2021 16:06:23 -0400 Subject: Gracefully handle failure to upload to hastebin in `!dmrelay`. --- bot/exts/moderation/dm_relay.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bot/exts/moderation/dm_relay.py b/bot/exts/moderation/dm_relay.py index 68a48c67c..1d2206e27 100644 --- a/bot/exts/moderation/dm_relay.py +++ b/bot/exts/moderation/dm_relay.py @@ -55,6 +55,11 @@ class DMRelay(Cog): ) paste_link = await send_to_paste_service(metadata + output, extension="txt") + + if paste_link is None: + await ctx.send(f"{Emojis.cross_mark} Failed to upload output to hastebin.") + return + await ctx.send(paste_link) async def cog_check(self, ctx: Context) -> bool: -- cgit v1.2.3 From 0b4e48883949213260733c3263b4067531f785ea Mon Sep 17 00:00:00 2001 From: Den4200 Date: Tue, 30 Mar 2021 16:21:16 -0400 Subject: Removed user event announcements from the config. --- bot/constants.py | 1 - config-default.yml | 3 --- 2 files changed, 4 deletions(-) diff --git a/bot/constants.py b/bot/constants.py index 4040d757e..91b60b9a6 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -402,7 +402,6 @@ class Channels(metaclass=YAMLGetter): python_events: int python_news: int reddit: int - user_event_announcements: int dev_contrib: int dev_core: int diff --git a/config-default.yml b/config-default.yml index 39b33ca10..e3fd98ac0 100644 --- a/config-default.yml +++ b/config-default.yml @@ -150,7 +150,6 @@ guild: python_events: &PYEVENTS_CHANNEL 729674110270963822 python_news: &PYNEWS_CHANNEL 704372456592506880 reddit: &REDDIT_CHANNEL 458224812528238616 - user_event_announcements: &USER_EVENT_A 592000283102674944 # Development dev_contrib: &DEV_CONTRIB 635950537262759947 @@ -322,7 +321,6 @@ filter: - *MOD_LOG - *STAFF_LOUNGE - *TALENT_POOL - - *USER_EVENT_A role_whitelist: - *ADMINS_ROLE @@ -511,7 +509,6 @@ duck_pond: - *PYEVENTS_CHANNEL - *MAILING_LISTS - *REDDIT_CHANNEL - - *USER_EVENT_A - *DUCK_POND - *CHANGE_LOG - *STAFF_ANNOUNCEMENTS -- cgit v1.2.3