@@ -85,7 +85,7 @@ def __init__(self, label: str = None,
85
85
self .custom_id = int (custom_id )
86
86
else :
87
87
self .custom_id = custom_id
88
- if self .custom_id and self .url :
88
+ if self .custom_id is not None and self .url :
89
89
raise URLAndCustomIDNotAlowed (self .custom_id )
90
90
if label and len (label ) > 80 :
91
91
raise InvalidArgument ('The maximum length of Button-Labels\' s are 80; your one is %s long. (%s Characters to long)' % (len (label ), len (label ) - 80 ))
@@ -212,7 +212,7 @@ def set_style_if(self, check: Union[bool, typing.Callable], style: ButtonStyle,
212
212
213
213
def to_dict (self ):
214
214
base = {'type' : 2 , 'label' : self .label , 'style' : int (self .style ), 'disabled' : self .disabled }
215
- if self .custom_id :
215
+ if self .custom_id is not None :
216
216
base ['custom_id' ] = str (self .custom_id )
217
217
elif self .url :
218
218
base ['url' ] = self .url
@@ -317,7 +317,7 @@ class SelectMenu:
317
317
318
318
Parameters
319
319
----------
320
- custom_id: Union[:class:` str`, :class:` int`]
320
+ custom_id: str or int
321
321
A developer-defined identifier for the :class:`SelectMenu`, max. 100 characters.
322
322
options: List[:class:`SelectOption`]
323
323
A :class:`list` of choices(:class:`SelectOption`) the :class:`SelectMenu` should have, max. 25.
@@ -390,7 +390,7 @@ def all_option_values(self):
390
390
def to_dict (self ) -> dict :
391
391
base = {
392
392
'type' : 3 ,
393
- 'custom_id' : self .custom_id ,
393
+ 'custom_id' : str ( self .custom_id ) ,
394
394
'options' : [o .to_dict () for o in self .options if isinstance (o , SelectOption )],
395
395
'placeholder' : self .placeholder ,
396
396
'min_values' : self .min_values ,
0 commit comments