I have problem in my ban and kick command if I write reason: None #9740
-
This is the Error message:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You annotated the type of the Type annotations are made up of multiple parts (some of which you don't always use): If you end up posting other questions please don't cut up the error in the middle (and use a large code block so the newlines work), the whole thing is useful to others when they want to help you. |
Beta Was this translation helpful? Give feedback.
You annotated the type of the
reason
argument asNone
instead of giving it a default value ofNone
which it seems you intended.Type annotations are made up of multiple parts (some of which you don't always use):
parameter: Type = Default
, so in your case you'd want to usereason: str | None = None
, making reason an optionalstr
with a default value ofNone
if it's not given.If you end up posting other questions please don't cut up the error in the middle (and use a large code block so the newlines work), the whole thing is useful to others when they want to help you.