fix(bot): 🐛 Hangup not working.
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user