fix(bot): 🐛 Hangup not working.

This commit is contained in:
Nyeki.py
2024-10-25 23:21:17 -03:00
parent 92904ea246
commit 27a528577b
+11 -3
View File
@@ -483,9 +483,17 @@ class Calls(base.Cog):
if is_on_call:
channel = await dbutils.get_channel(ctx.channel)
call = await models.Call.get(id=channel.call_id).prefetch_related(
"channels"
)
try:
call = await models.Call.get(id=channel.call_id).prefetch_related(
"channels"
)
except exceptions.DoesNotExist:
await self.bot.redis.srem(constants.CHANNELS_ONCALL_SET, channel_id)
await ctx.send(f"☎️ {secrets.choice(constants.MSGS_PHONE_HANGUP_ME)}")
return
await self.bot.redis.sadd(constants.CALL_IDS_TO_FLUSH, call.id)