mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 20:28:38 +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}>'
|
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
|
@classmethod
|
||||||
def from_dict(cls, data: SelectOptionPayload) -> SelectOption:
|
def from_dict(cls, data: SelectOptionPayload) -> SelectOption:
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user