fix(bot): 🚑 Hangup not working.
This commit is contained in:
@@ -466,20 +466,22 @@ class Calls(base.Cog):
|
||||
constants.CHANNELS_ONCALL_SET, str(channel_id), str(other_channel.id)
|
||||
)
|
||||
|
||||
try:
|
||||
await (await self.bot.get_or_fetch_channel(other_channel.id)).send(
|
||||
f"☎️ {secrets.choice(constants.MSGS_PHONE_HANGUP_YOU)}"
|
||||
)
|
||||
if other_channel is not None:
|
||||
try:
|
||||
await (await self.bot.get_or_fetch_channel(other_channel.id)).send(
|
||||
f"☎️ {secrets.choice(constants.MSGS_PHONE_HANGUP_YOU)}"
|
||||
)
|
||||
|
||||
except errors.DiscordException:
|
||||
pass
|
||||
except errors.DiscordException:
|
||||
pass
|
||||
|
||||
other_channel.call = None
|
||||
|
||||
await ctx.send(f"☎️ {secrets.choice(constants.MSGS_PHONE_HANGUP_ME)}")
|
||||
|
||||
channel.call = None
|
||||
other_channel.call = None
|
||||
|
||||
await models.Channel.bulk_update([channel, other_channel], ["call_id"])
|
||||
await models.Channel.bulk_update([channel] + ([other_channel] if other_channel is not None else []), ["call_id"])
|
||||
|
||||
call.ended_at = datetime.now(timezone.utc)
|
||||
await call.save()
|
||||
|
||||
Reference in New Issue
Block a user