diff options
author | 2022-12-14 16:58:56 +0800 | |
---|---|---|
committer | 2022-12-14 16:58:56 +0800 | |
commit | 318d67d2f5803c904168ee1db5f877c284647415 (patch) | |
tree | 71be583ac6bad08feb21179258adb60b82af819d | |
parent | Update `prepare_timeit_input` docstring (diff) | |
parent | Merge pull request #2357 from python-discord/update-modlog-for-threads (diff) |
Merge branch 'main' into snekbox-files
-rw-r--r-- | bot/exts/help_channels/_caches.py | 2 | ||||
-rw-r--r-- | bot/exts/help_channels/_channel.py | 2 | ||||
-rw-r--r-- | bot/exts/help_channels/_cog.py | 2 | ||||
-rw-r--r-- | bot/exts/moderation/modlog.py | 23 | ||||
-rw-r--r-- | bot/resources/tags/return-gif.md (renamed from bot/resources/tags/print-return.md) | 1 | ||||
-rw-r--r-- | poetry.lock | 6 |
6 files changed, 11 insertions, 25 deletions
diff --git a/bot/exts/help_channels/_caches.py b/bot/exts/help_channels/_caches.py index 5d98f99d3..3369fc0a6 100644 --- a/bot/exts/help_channels/_caches.py +++ b/bot/exts/help_channels/_caches.py @@ -9,6 +9,6 @@ help_dm = RedisCache(namespace="HelpChannels.help_dm") # RedisCache[discord.TextChannel.id, str[set[discord.User.id]]] session_participants = RedisCache(namespace="HelpChannels.session_participants") -# Stores posts that have had a non-claimant reply. +# Stores posts that have had a non-claimant, non-bot, reply. # Currently only used to determine whether the post was answered or not when collecting stats. posts_with_non_claimant_messages = RedisCache(namespace="HelpChannels.posts_with_non_claimant_messages") diff --git a/bot/exts/help_channels/_channel.py b/bot/exts/help_channels/_channel.py index 5c47a3559..fad2a32a9 100644 --- a/bot/exts/help_channels/_channel.py +++ b/bot/exts/help_channels/_channel.py @@ -94,7 +94,7 @@ async def send_opened_post_dm(post: discord.Thread) -> None: return formatted_message = textwrap.shorten(message.content, width=100, placeholder="...").strip() - if formatted_message is None: + if not formatted_message: # This most likely means the initial message is only an image or similar formatted_message = "No text content." diff --git a/bot/exts/help_channels/_cog.py b/bot/exts/help_channels/_cog.py index 31f30b7aa..bc6bd0303 100644 --- a/bot/exts/help_channels/_cog.py +++ b/bot/exts/help_channels/_cog.py @@ -179,5 +179,5 @@ class HelpForum(commands.Cog): await _message.notify_session_participants(message) - if message.author.id != message.channel.owner_id: + if not message.author.bot and message.author.id != message.channel.owner_id: await _caches.posts_with_non_claimant_messages.set(message.channel.id, "sentinel") diff --git a/bot/exts/moderation/modlog.py b/bot/exts/moderation/modlog.py index d916d1f4d..eeaf69139 100644 --- a/bot/exts/moderation/modlog.py +++ b/bot/exts/moderation/modlog.py @@ -826,7 +826,8 @@ class ModLog(Cog, name="ModLog"): ( f"Thread {after.mention} ({after.name}, `{after.id}`) from {after.parent.mention} " f"(`{after.parent.id}`) was {action}" - ) + ), + channel_id=Channels.message_log, ) @Cog.listener() @@ -843,24 +844,8 @@ class ModLog(Cog, name="ModLog"): ( f"Thread {thread.mention} ({thread.name}, `{thread.id}`) from {thread.parent.mention} " f"(`{thread.parent.id}`) deleted" - ) - ) - - @Cog.listener() - async def on_thread_create(self, thread: Thread) -> None: - """Log thread creation.""" - if self.is_channel_ignored(thread.id): - log.trace("Ignoring creation of thread %s (%d)", thread.mention, thread.id) - return - - await self.send_log_message( - Icons.hash_green, - Colours.soft_green, - "Thread created", - ( - f"Thread {thread.mention} ({thread.name}, `{thread.id}`) from {thread.parent.mention} " - f"(`{thread.parent.id}`) created" - ) + ), + channel_id=Channels.message_log, ) @Cog.listener() diff --git a/bot/resources/tags/print-return.md b/bot/resources/tags/return-gif.md index 89d37053f..1229151fe 100644 --- a/bot/resources/tags/print-return.md +++ b/bot/resources/tags/return-gif.md @@ -1,4 +1,5 @@ --- +aliases: ["print-return", "return-jif"] embed: title: Print and Return image: diff --git a/poetry.lock b/poetry.lock index 4461e8b3f..f418c0516 100644 --- a/poetry.lock +++ b/poetry.lock @@ -105,7 +105,7 @@ lxml = ["lxml"] [[package]] name = "certifi" -version = "2022.9.24" +version = "2022.12.7" description = "Python package for providing Mozilla's CA Bundle." category = "main" optional = false @@ -1234,8 +1234,8 @@ beautifulsoup4 = [ {file = "beautifulsoup4-4.11.1.tar.gz", hash = "sha256:ad9aa55b65ef2808eb405f46cf74df7fcb7044d5cbc26487f96eb2ef2e436693"}, ] certifi = [ - {file = "certifi-2022.9.24-py3-none-any.whl", hash = "sha256:90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382"}, - {file = "certifi-2022.9.24.tar.gz", hash = "sha256:0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14"}, + {file = "certifi-2022.12.7-py3-none-any.whl", hash = "sha256:4ad3232f5e926d6718ec31cfc1fcadfde020920e278684144551c91769c7bc18"}, + {file = "certifi-2022.12.7.tar.gz", hash = "sha256:35824b4c3a97115964b408844d64aa14db1cc518f6562e8d7261699d1350a9e3"}, ] cffi = [ {file = "cffi-1.15.1-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:a66d3508133af6e8548451b25058d5812812ec3798c886bf38ed24a98216fab2"}, |