-
Notifications
You must be signed in to change notification settings - Fork 0
Reading arguments
The native SerializedArgumentParser
s and SwitchArgumentParser
s provide you with help strings along with the usage and syntax. If you'd like to include spaces in your argument for the commands that support it, simply put your argument into quotes.
An example argument string looks like this: <argument1:String> [argument2:User]
[argument]
- optional argument, with the default value set
<argument>
- required argument, the default value is not set
argumentName...
- a catch-all argument, all the arguments after this argument are combined into a single string and then resolved to this type
argumentName...*
- a rest argument, all the arguments after this argument are resolved to this type without combining it into a single string
The switch syntax uses pairs of key:value
in order to resolve arguments. This makes it easy to make the arguments positional.
By example:
tt.userinfo [user:Member...] => tt.userinfo Random Wumpus#0001 => Random Wumpus#0001's data get passed to the command
=> tt.userinfo => Your data get passed to the command
tt.emoji <emojis:Emoji...*> => tt.emoji :flushed: :100: :+1: => :flushed:, :100: and :+1: get passed to the command separately
=> tt.emoji invalidEmoji => Command throws an error
=> tt.emoji => Command throws an error
tt.ban <user:Member> [reason:String] => tt.ban "user:Random Wumpus#0001" => Random Wumpus#0001's data get passed to the command, with reason set to the default string
tt.clear [messages:Number] [contains:String] => tt.emoji contains:air messages:10 => The message count (10), and the search string (air) get passed to the command, with other arguments set to their defaults (if any)
Need any help? Check out the documentation or join our Discord server!