Merge pull request #20 from Payphone-Bot/19-doesnotexist-error-in-on_raw_message_edit-and-probably-in-on_raw_message_delete-too

fix(bot): 🐛 `DoesNotExist` in `on_raw_message_*` when no calls are ongoing in that channel.
This commit is contained in:
Rafael Bradley
2024-10-20 23:58:08 -03:00
committed by GitHub
+8 -2
View File
@@ -907,7 +907,10 @@ class Calls(base.Cog):
message_id = payload.message_id
channel_id = payload.channel_id
channel = await models.Channel.get(id=channel_id)
channel = await models.Channel.get_or_none(id=channel_id)
if channel is None:
return
if channel.call_id is None:
return
@@ -984,7 +987,10 @@ class Calls(base.Cog):
channel_id = payload.channel_id
content = payload.data["content"]
channel = await models.Channel.get(id=channel_id)
channel = await models.Channel.get_or_none(id=channel_id)
if channel is None:
return
if channel.call_id is None:
return