From 8d970bb222ba1ceececff0104da7eb2f71059e20 Mon Sep 17 00:00:00 2001 From: Solumath Date: Sun, 3 Nov 2024 20:28:27 +0100 Subject: [PATCH] fix: unknown channel_id for ctx commands --- features/error.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/features/error.py b/features/error.py index b7c48a58..67210246 100644 --- a/features/error.py +++ b/features/error.py @@ -33,7 +33,8 @@ class ContextMock: message: disnake.Message def __init__(self, bot: Rubbergod, arg): - self.channel = getattr(arg, "channel", bot.get_channel(arg.channel_id)) + channel_id = getattr(arg, "channel_id", arg.channel.id) + self.channel = getattr(arg, "channel", bot.get_channel(channel_id)) if hasattr(arg, "author"): self.author = arg.author elif hasattr(arg, "member"):