Skip to content

RequiredArg

Felix44 edited this page Aug 23, 2021 · 4 revisions

This class is used for creating the Command class, it has 2 main uses: throw an error if the defined argument is not given and show the argument when using &help


Constructor:

  1. argnum (number): this is the argument number this class needs to check, 0 would be the first argument, 1 the second and so on
  2. errormsg (string): this string that the bot will send if the required argument
  3. name (string): this string that rappresents the name of the argument, will appear when using &help with the command
  4. notrequired (boolean): if true, the check will be skipped when called, and this class will only be used to display the class name when using &help

Methods:

  • check (array args): will check if args has a value in the position this.argnum

Classes:

Clone this wiki locally