mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-08 04:38:42 +00:00
Fix passing None to ForumTag.emoji constructor
This commit is contained in:
parent
e1961676a9
commit
46d194df57
@ -2006,7 +2006,7 @@ class ForumTag(Hashable):
|
|||||||
|
|
||||||
__slots__ = ('name', 'id', 'moderated', 'emoji')
|
__slots__ = ('name', 'id', 'moderated', 'emoji')
|
||||||
|
|
||||||
def __init__(self, *, name: str, emoji: Optional[EmojiInputType], moderated: bool = False) -> None:
|
def __init__(self, *, name: str, emoji: Optional[EmojiInputType] = None, moderated: bool = False) -> None:
|
||||||
self.name: str = name
|
self.name: str = name
|
||||||
self.id: int = 0
|
self.id: int = 0
|
||||||
self.moderated: bool = moderated
|
self.moderated: bool = moderated
|
||||||
@ -2015,8 +2015,8 @@ class ForumTag(Hashable):
|
|||||||
self.emoji = emoji._to_partial()
|
self.emoji = emoji._to_partial()
|
||||||
elif isinstance(emoji, str):
|
elif isinstance(emoji, str):
|
||||||
self.emoji = PartialEmoji.from_str(emoji)
|
self.emoji = PartialEmoji.from_str(emoji)
|
||||||
else:
|
elif emoji is not None:
|
||||||
raise TypeError(f'emoji must be a Emoji, PartialEmoji, or str not {emoji.__class__.__name__}')
|
raise TypeError(f'emoji must be a Emoji, PartialEmoji, str or None not {emoji.__class__.__name__}')
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_data(cls, *, state: ConnectionState, data: ForumTagPayload) -> Self:
|
def from_data(cls, *, state: ConnectionState, data: ForumTagPayload) -> Self:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user