aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2024-03-24 22:35:49 +0000
committerGravatar Chris Lovering <[email protected]>2024-03-26 15:27:59 +0000
commit29945927c6652ef3ac77a3c83d21584dc12052bb (patch)
tree78ce08fa5b6ce774a788180fb0d62d0501a94308
parentRemove the help-dm feature (diff)
Remove the DM sent to users when they open a help post
This is no longer needed now that the new forum channel used for the help system automatically have the new post shown in the channel list
-rw-r--r--bot/exts/help_channels/_channel.py41
1 files changed, 0 insertions, 41 deletions
diff --git a/bot/exts/help_channels/_channel.py b/bot/exts/help_channels/_channel.py
index ed9f5c346..cf3cdbaf6 100644
--- a/bot/exts/help_channels/_channel.py
+++ b/bot/exts/help_channels/_channel.py
@@ -1,5 +1,4 @@
"""Contains all logic to handle changes to posts in the help forum."""
-import textwrap
from datetime import timedelta
import arrow
@@ -86,44 +85,6 @@ async def send_opened_post_message(post: discord.Thread) -> None:
await post.send(embed=embed, content=post.owner.mention)
-async def send_opened_post_dm(post: discord.Thread) -> None:
- """Send the opener a DM message with a jump link to their new post."""
- embed = discord.Embed(
- title="Help post opened",
- description=f"You opened {post.mention}.",
- colour=constants.Colours.bright_green,
- timestamp=post.created_at,
- )
- embed.set_thumbnail(url=constants.Icons.green_questionmark)
- message = post.starter_message
- if not message:
- try:
- message = await post.fetch_message(post.id)
- except discord.HTTPException:
- log.warning(f"Could not fetch message for post {post.id}")
- return
-
- formatted_message = textwrap.shorten(message.content, width=100, placeholder="...").strip()
- if not formatted_message:
- # This most likely means the initial message is only an image or similar
- formatted_message = "No text content."
-
- embed.add_field(name="Your message", value=formatted_message, inline=False)
- embed.add_field(
- name="Conversation",
- value=f"[Jump to message!]({message.jump_url})",
- inline=False,
- )
-
- try:
- await post.owner.send(embed=embed)
- log.trace(f"Sent DM to {post.owner} ({post.owner_id}) after posting in help forum.")
- except discord.errors.Forbidden:
- log.trace(
- f"Ignoring to send DM to {post.owner} ({post.owner_id}) after posting in help forum: DMs disabled.",
- )
-
-
async def help_post_opened(opened_post: discord.Thread, *, reopen: bool = False) -> None:
"""Apply new post logic to a new help forum post."""
_stats.report_post_count()
@@ -134,8 +95,6 @@ async def help_post_opened(opened_post: discord.Thread, *, reopen: bool = False)
await _close_help_post(opened_post, _stats.ClosingReason.CLEANUP)
return
- await send_opened_post_dm(opened_post)
-
try:
await opened_post.starter_message.pin()
except (discord.HTTPException, AttributeError) as e: