fix(bot): 🐛 Fix hangup_calls().
This commit is contained in:
@@ -24,7 +24,7 @@ class Calls(base.Cog):
|
|||||||
def __init__(self, bot_instance: bot.Payphone):
|
def __init__(self, bot_instance: bot.Payphone):
|
||||||
self.bot = bot_instance
|
self.bot = bot_instance
|
||||||
|
|
||||||
self.hangup_calls.add_exception_type(Exception)
|
self.hangup_calls.add_exception_type(exceptions.ConfigurationError)
|
||||||
self.hangup_calls.start()
|
self.hangup_calls.start()
|
||||||
|
|
||||||
def cog_unload(self) -> None:
|
def cog_unload(self) -> None:
|
||||||
@@ -73,10 +73,10 @@ class Calls(base.Cog):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
if len(hung_up_channel_ids) > 0:
|
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(
|
await self.bot.redis.srem(
|
||||||
constants.CHANNELS_ONCALL_SET, *hung_up_channel_ids
|
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.command(aliases=["c"])
|
||||||
@commands.guild_only()
|
@commands.guild_only()
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ class Mods(base.Cog):
|
|||||||
total = await models.Report.filter(status=models.ReportStatus.ON_REVIEW).count()
|
total = await models.Report.filter(status=models.ReportStatus.ON_REVIEW).count()
|
||||||
|
|
||||||
if report is None:
|
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
|
return
|
||||||
|
|
||||||
await ctx.send(
|
await ctx.send(
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ class ReportView(discord.ui.View):
|
|||||||
|
|
||||||
if report is None:
|
if report is None:
|
||||||
await interaction.response.edit_message(
|
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,
|
embed=None,
|
||||||
view=None,
|
view=None,
|
||||||
)
|
)
|
||||||
@@ -224,7 +224,7 @@ class ReportView(discord.ui.View):
|
|||||||
|
|
||||||
if report is None:
|
if report is None:
|
||||||
await interaction.response.edit_message(
|
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,
|
embed=None,
|
||||||
view=None,
|
view=None,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user