fix(bot): 🚑 Hangup not working.
This commit is contained in:
@@ -466,6 +466,7 @@ class Calls(base.Cog):
|
|||||||
constants.CHANNELS_ONCALL_SET, str(channel_id), str(other_channel.id)
|
constants.CHANNELS_ONCALL_SET, str(channel_id), str(other_channel.id)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if other_channel is not None:
|
||||||
try:
|
try:
|
||||||
await (await self.bot.get_or_fetch_channel(other_channel.id)).send(
|
await (await self.bot.get_or_fetch_channel(other_channel.id)).send(
|
||||||
f"☎️ {secrets.choice(constants.MSGS_PHONE_HANGUP_YOU)}"
|
f"☎️ {secrets.choice(constants.MSGS_PHONE_HANGUP_YOU)}"
|
||||||
@@ -474,12 +475,13 @@ class Calls(base.Cog):
|
|||||||
except errors.DiscordException:
|
except errors.DiscordException:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
other_channel.call = None
|
||||||
|
|
||||||
await ctx.send(f"☎️ {secrets.choice(constants.MSGS_PHONE_HANGUP_ME)}")
|
await ctx.send(f"☎️ {secrets.choice(constants.MSGS_PHONE_HANGUP_ME)}")
|
||||||
|
|
||||||
channel.call = None
|
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)
|
call.ended_at = datetime.now(timezone.utc)
|
||||||
await call.save()
|
await call.save()
|
||||||
|
|||||||
Reference in New Issue
Block a user