From 2efd4a50b857ca90af045ef0b22bf9521bd655b4 Mon Sep 17 00:00:00 2001 From: Jerrie-Aries <70805800+Jerrie-Aries@users.noreply.github.com> Date: Wed, 13 Jan 2021 19:33:55 +0800 Subject: [PATCH 1/2] Fix `logs` command without argument in thread channel when the recipient is not cached. --- cogs/modmail.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cogs/modmail.py b/cogs/modmail.py index 29a3c79df4..ee109420af 100644 --- a/cogs/modmail.py +++ b/cogs/modmail.py @@ -680,7 +680,7 @@ async def logs(self, ctx, *, user: User = None): thread = ctx.thread if not thread: raise commands.MissingRequiredArgument(SimpleNamespace(name="member")) - user = thread.recipient + user = thread.recipient or await self.bot.fetch_user(thread.id) default_avatar = "https://cdn.discordapp.com/embed/avatars/0.png" icon_url = getattr(user, "avatar_url", default_avatar) From 232accba33a700b48cda451980774fc7fe188cc5 Mon Sep 17 00:00:00 2001 From: Jerrie-Aries <70805800+Jerrie-Aries@users.noreply.github.com> Date: Wed, 13 Jan 2021 19:44:18 +0800 Subject: [PATCH 2/2] Fix error raised when recipient is not cached and reacts to reactions in DM channel. --- bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 3b2d228505..54006ad8fc 100644 --- a/bot.py +++ b/bot.py @@ -1153,7 +1153,7 @@ async def on_typing(self, channel, user, _): async def handle_reaction_events(self, payload): user = self.get_user(payload.user_id) - if user.bot: + if user is None or user.bot: return channel = self.get_channel(payload.channel_id)