mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-21 00:07:51 +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')
|
||||
|
||||
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.id: int = 0
|
||||
self.moderated: bool = moderated
|
||||
@ -2015,8 +2015,8 @@ class ForumTag(Hashable):
|
||||
self.emoji = emoji._to_partial()
|
||||
elif isinstance(emoji, str):
|
||||
self.emoji = PartialEmoji.from_str(emoji)
|
||||
else:
|
||||
raise TypeError(f'emoji must be a Emoji, PartialEmoji, or str not {emoji.__class__.__name__}')
|
||||
elif emoji is not None:
|
||||
raise TypeError(f'emoji must be a Emoji, PartialEmoji, str or None not {emoji.__class__.__name__}')
|
||||
|
||||
@classmethod
|
||||
def from_data(cls, *, state: ConnectionState, data: ForumTagPayload) -> Self:
|
||||
|
Loading…
x
Reference in New Issue
Block a user