Skip to content

I have problem in my ban and kick command if I write reason: None #9740

Answered by LostLuma
Tasfinthebigboy asked this question in Q&A
Discussion options

You must be logged in to vote

You annotated the type of the reason argument as None instead of giving it a default value of None 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 use reason: str | None = None, making reason an optional str with a default value of None 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.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Tasfinthebigboy
Comment options

Answer selected by Rapptz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants