From e0851280df91774774ac80341853452297b2fbe5 Mon Sep 17 00:00:00 2001 From: "Nyeki.py" <84998222+Nekidev@users.noreply.github.com> Date: Fri, 18 Oct 2024 12:56:46 -0300 Subject: [PATCH] fix(bot): :bug: Fix `hangup_calls()`. --- payphone/cogs/calls/cog.py | 4 ++-- payphone/cogs/mods/cog.py | 2 +- payphone/cogs/mods/views.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/payphone/cogs/calls/cog.py b/payphone/cogs/calls/cog.py index 5e99d04..2bd5f17 100644 --- a/payphone/cogs/calls/cog.py +++ b/payphone/cogs/calls/cog.py @@ -24,7 +24,7 @@ class Calls(base.Cog): def __init__(self, bot_instance: bot.Payphone): self.bot = bot_instance - self.hangup_calls.add_exception_type(Exception) + self.hangup_calls.add_exception_type(exceptions.ConfigurationError) self.hangup_calls.start() def cog_unload(self) -> None: @@ -73,10 +73,10 @@ class Calls(base.Cog): pass if len(hung_up_channel_ids) > 0: + await models.Channel.filter(id__in=hung_up_channel_ids).update(call=None) await self.bot.redis.srem( constants.CHANNELS_ONCALL_SET, *hung_up_channel_ids ) - await models.Channel.filter(id__in=hung_up_channel_ids).update(call=None) @commands.command(aliases=["c"]) @commands.guild_only() diff --git a/payphone/cogs/mods/cog.py b/payphone/cogs/mods/cog.py index 4f7b703..8f39238 100644 --- a/payphone/cogs/mods/cog.py +++ b/payphone/cogs/mods/cog.py @@ -189,7 +189,7 @@ class Mods(base.Cog): total = await models.Report.filter(status=models.ReportStatus.ON_REVIEW).count() if report is None: - await ctx.send("✅ You're up to date! No reports left to check.") + await ctx.send("No reports left, treat yourself with this cookie 🍪 !!") return await ctx.send( diff --git a/payphone/cogs/mods/views.py b/payphone/cogs/mods/views.py index 7a68ee8..570a7f1 100644 --- a/payphone/cogs/mods/views.py +++ b/payphone/cogs/mods/views.py @@ -191,7 +191,7 @@ class ReportView(discord.ui.View): if report is None: await interaction.response.edit_message( - content="✅ You're up to date! No reports left to check.", + content="No reports left, treat yourself with this cookie 🍪 !!", embed=None, view=None, ) @@ -224,7 +224,7 @@ class ReportView(discord.ui.View): if report is None: await interaction.response.edit_message( - content="✅ You're up to date! No reports left to check.", + content="No reports left, treat yourself with this cookie 🍪 !!", embed=None, view=None, )