Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cogs/reminders.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ async def my_reminders(self, ctx):
for message, _, timestamp in reminders:
embed.add_field(
name=f"Reminder at {timestamp.strftime('%Y-%m-%d %H:%M:%S')}",
value=f"Message: {message or "-"}",
value=f"Message: {message or '-'}",
inline=False
)
await ctx.reply(embed=embed)
Expand All @@ -70,7 +70,7 @@ async def check_reminders(self):
user_id, channel_id, message = reminder
channel = self.bot.get_channel(channel_id) or await self.bot.fetch_channel(channel_id)
try:
await channel.send(f"<@{user_id}>{f": {message}" if message else ""}")
await channel.send(f"<@{user_id}>: {message}" if message else '')
except discord.Forbidden:
# If the bot cannot send messages to the channel, skip it
continue
Expand Down
25 changes: 21 additions & 4 deletions util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import typing
from random import choice
from copy import copy
from io import StringIO

import discord
from discord import app_commands
Expand Down Expand Up @@ -284,13 +285,29 @@ async def create_deletion_embed(
if len(message.message_snapshots) > 0:
embed.add_field(
name="Forwarded Message Content",
value=f"||{message.message_snapshots[0].content}||" or "No content",
value=f"||{return_or_truncate(message.message_snapshots[0].content, 500)}||" if len(message.message_snapshots[0].content) > 0 else "No content",
inline=False,
)
attachments = [await attachment.to_file() for attachment in message.message_snapshots[0].attachments]
attachments = [await attachment.to_file(spoiler=True) for attachment in message.message_snapshots[0].attachments]
# On long message, provide a .txt file with full content
if len(message.message_snapshots[0].content) > 500:
full_content_file = discord.File(
fp=StringIO(message.message_snapshots[0].content),
filename=f"message_{message.id}_full_content.txt",
spoiler=True,
)
attachments.append(full_content_file)
else:
embed.add_field(name="Message Content", value=f"||{message.content}||" or "No content", inline=False)
attachments = [await attachment.to_file() for attachment in message.attachments]
embed.add_field(name="Message Content", value=f"||{return_or_truncate(message.content, 500)}||" if len(message.content) > 0 else "No content", inline=False)
attachments = [await attachment.to_file(spoiler=True) for attachment in message.attachments]
# On long message, provide a .txt file with full content
if len(message.content) > 500:
full_content_file = discord.File(
fp=StringIO(message.content),
filename=f"message_{message.id}_full_content.txt",
spoiler=True,
)
attachments.append(full_content_file)
embed.add_field(name="Channel", value=message.channel.jump_url, inline=True)
embed.add_field(name="Context", value=message.jump_url, inline=True)
embed.set_footer(text=f"Message ID: {message.id}")
Expand Down