Skip to content

Instantly share code, notes, and snippets.

@YorkAARGH
Last active October 23, 2016 10:10
Show Gist options
  • Save YorkAARGH/9a9d78e46fa25fcd73035fb17bc1e14c to your computer and use it in GitHub Desktop.
Save YorkAARGH/9a9d78e46fa25fcd73035fb17bc1e14c to your computer and use it in GitHub Desktop.

Argument Usage in Komada

Usage Structure

<> required argument, [] optional argument <Name:Type{min,max}>

  • Name Mostly used for debugging message, unless the type is Litteral in which it compares the argument to the name.
  • Type The type of variable you are expecting
  • Min, Max Minimum or Maximum for a giving variable (works on strings in terms of length, and on all types of numbers in terms of value) You are allowed to define any combination of min and max. Omit for none, {min} for min, {,max} for max.
  • Special Repeat Tag [...] will repeat the last usage optionally until you run out of arguments. Useful for doing something like <SearchTerm:str> [...] which will allow you to take as many search terms as you want, per your Usage Deliminator.

= Usage Types =

  • literal : Literally equal to the Name. This is the default type if none is defined.
  • str, string : Strings
  • int, integer : Integers
  • num, number, Float : Floating point numbers
  • url : a url
  • msg, message : A message object returned from the message id (now using fetchMessage for bot accounts, and fetchMessages for selfbots as of 3f24cc99c5e15861f63a8c174fb6469c87475c23)
  • channel : A channel object returned from the channel id or channel tag
  • guild : A guild object returned from the guild id
  • user, mention : A user object returned from the user id or mention
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment