From 7e4e354819de7530c3f504c119c6e4b46aeb0a5d Mon Sep 17 00:00:00 2001 From: Rafael Bradley Date: Sat, 15 Mar 2025 13:39:45 -0300 Subject: [PATCH] fix(shard): :ambulance: Report message command not working. --- payphone/cogs/calls/cog.py | 20 +++++++++++--------- pyproject.toml | 2 +- uv.lock | 2 +- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/payphone/cogs/calls/cog.py b/payphone/cogs/calls/cog.py index 0179546..bdea272 100644 --- a/payphone/cogs/calls/cog.py +++ b/payphone/cogs/calls/cog.py @@ -475,7 +475,17 @@ class Calls(base.Cog): "❌ You're banned from using Payphone.", ephemeral=True ) - if not await self.bot.call_handler.get_message(message.id): + if message.author.bot: + message_id = await self.bot.call_handler.get_original_message_id(message.id) + author_id = await self.bot.call_handler.get_message_author_id(message_id) + found_message = bool(author_id) + + else: + message_id = message.id + author_id = message.author.id + found_message = bool(await self.bot.call_handler.get_message(message.id)) + + if not found_message: return await ctx.send_response( ( "❌ More than 15 minutes have passed since this message was sent.\n" @@ -484,14 +494,6 @@ class Calls(base.Cog): ephemeral=True, ) - if message.author.bot: - message_id = await self.bot.call_handler.get_original_message_id(message.id) - author_id = await self.bot.call_handler.get_message_author_id(message_id) - - else: - message_id = message.id - author_id = message.author.id - await ctx.send_response("✅ The message has been reported.", ephemeral=True) await models.Report.update_or_create( diff --git a/pyproject.toml b/pyproject.toml index 4704aa4..a0f6d04 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "payphone" -version = "0.40.0" +version = "0.41.0" description = "Add your description here" readme = "README.md" requires-python = ">=3.12" diff --git a/uv.lock b/uv.lock index 2452c02..da9cfad 100644 --- a/uv.lock +++ b/uv.lock @@ -353,7 +353,7 @@ wheels = [ [[package]] name = "payphone" -version = "0.39.0" +version = "0.41.0" source = { virtual = "." } dependencies = [ { name = "aerich" },