fix(bot): 🐛 Hangup not working.

This commit is contained in:
Nyeki.py
2024-10-25 23:21:17 -03:00
parent 92904ea246
commit 27a528577b
+8
View File
@@ -483,10 +483,18 @@ class Calls(base.Cog):
if is_on_call: if is_on_call:
channel = await dbutils.get_channel(ctx.channel) channel = await dbutils.get_channel(ctx.channel)
try:
call = await models.Call.get(id=channel.call_id).prefetch_related( call = await models.Call.get(id=channel.call_id).prefetch_related(
"channels" "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) await self.bot.redis.sadd(constants.CALL_IDS_TO_FLUSH, call.id)
other_channel: models.Channel = find( other_channel: models.Channel = find(