mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-03 18:42:43 +00:00
Add SelectOption.__str__
This commit is contained in:
parent
7598865609
commit
feb0f7f29d
@ -324,6 +324,16 @@ class SelectOption:
|
||||
f'emoji={self.emoji!r} default={self.default!r}>'
|
||||
)
|
||||
|
||||
def __str__(self) -> str:
|
||||
if self.emoji:
|
||||
base = f'{self.emoji} {self.label}'
|
||||
else:
|
||||
base = self.label
|
||||
|
||||
if self.description:
|
||||
return f'{base}\n{self.description}'
|
||||
return base
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, data: SelectOptionPayload) -> SelectOption:
|
||||
try:
|
||||
|
Loading…
x
Reference in New Issue
Block a user