Browse Source

Add SelectOption.__str__

pull/7172/head
Rapptz 4 years ago
parent
commit
feb0f7f29d
  1. 10
      discord/components.py

10
discord/components.py

@ -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…
Cancel
Save