fix (context): Fix ctx repr in private channels.
This commit is contained in:
@@ -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,6 +65,9 @@ class LionContext(Context['LionBot']):
|
||||
parts['uname'] = f"\"{self.author.name}\""
|
||||
if self.channel is not None:
|
||||
parts['cid'] = self.channel.id
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user