From d93f31d29557fde7a945d735e12fe0c5016a3356 Mon Sep 17 00:00:00 2001 From: Conatum Date: Tue, 22 Aug 2023 23:11:46 +0300 Subject: [PATCH] fix (context): Fix ctx repr in private channels. --- src/meta/LionContext.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/meta/LionContext.py b/src/meta/LionContext.py index 2c326d28..64746a5e 100644 --- a/src/meta/LionContext.py +++ b/src/meta/LionContext.py @@ -4,6 +4,7 @@ from collections import namedtuple from typing import Optional, TYPE_CHECKING import discord +from discord.enums import ChannelType from discord.ext.commands import Context if TYPE_CHECKING: @@ -64,7 +65,10 @@ class LionContext(Context['LionBot']): parts['uname'] = f"\"{self.author.name}\"" if self.channel is not None: parts['cid'] = self.channel.id - parts['cname'] = f"\"{self.channel.name}\"" + if self.channel.type is ChannelType.private: + parts['cname'] = f"\"{self.channel.recipient}\"" + else: + parts['cname'] = f"\"{self.channel.name}\"" if self.guild is not None: parts['gid'] = self.guild.id parts['gname'] = f"\"{self.guild.name}\""