feat(shard): ✨ Add p.bans command for moderators to see a user's bans.

This commit is contained in:
2025-03-15 23:26:19 -03:00
parent 7e4e354819
commit 481fba860e
10 changed files with 477 additions and 244 deletions
+24
View File
@@ -496,6 +496,20 @@ class Calls(base.Cog):
await ctx.send_response("✅ The message has been reported.", ephemeral=True)
replying_to = (
await self.bot.get_partial_messageable(
message.reference.channel_id
).fetch_message(message.reference.message_id)
if message.reference and not message.reference.cached_message
else (
message.reference.cached_message
if message.reference and message.reference.cached_message
else None
)
)
self.bot.log.info(replying_to)
await models.Report.update_or_create(
message_id=message_id,
defaults={
@@ -504,6 +518,16 @@ class Calls(base.Cog):
"user_name": message.author.display_name,
"user_avatar_url": message.author.display_avatar.url,
"message_content": message.content,
"reply_message_content": (
replying_to.clean_content if replying_to else None
),
"reply_user_id": (replying_to.author.id if replying_to else None),
"reply_user_name": (
replying_to.author.display_name if replying_to else None
),
"reply_user_avatar_url": (
replying_to.author.display_avatar.url if replying_to else None
),
},
)