Command

Undocumented

  • Returns an array of possible usages. * means a parameter; … means a variable number of parameters.

    Declaration

    Swift

    open class func usage() -> [String]
  • Returns a ChatUser’s privileges.

    Declaration

    Swift

    open class func privileges() -> ChatUser.Privileges
  • The message that triggered this command.

    Declaration

    Swift

    open let message: ChatMessage
  • Undocumented

  • Whether the command has completed execution. Will be set to true automatically by ChatListener.

    Declaration

    Swift

    open internal(set) var finished = false
  • Arguments passed to the command.

    Declaration

    Swift

    open let arguments: [String]
  • Which usage of the command was run. Useful for implementing commands that share most of their code, like shutdown/reboot.

    Declaration

    Swift

    open let usageIndex: Int
  • Replies to the message.

    Declaration

    Swift

    open func reply(_ reply: String)
  • Posts a message.

    Declaration

    Swift

    open func post(_ message: String)
  • Runs the command.

    Declaration

    Swift

    open func run() throws
  • Initializes a Command.

    Declaration

    Swift

    public required init(listener: ChatListener, message: ChatMessage, arguments: [String], usageIndex: Int = 0)