CommandEvent
public struct CommandEvent
Event passed in to a command closure containing required data.
-
Refference to
SwiftHooksinstance dispatching this command.Declaration
Swift
public let hooks: SwiftHooks -
User that executed the command. Can be downcast to backend specific type.
Declaration
Swift
public let user: Userable -
String arguments passed in to the command. All space separated strings after the commands trigger.
Declaration
Swift
public let args: [String] -
Message that executed the command.
Declaration
Swift
public let message: Messageable -
Full trigger of the command. Either name or name and group.
Declaration
Swift
public let name: String -
Hook that originally dispatched this command. Can be downcast to backend specific type.
Declaration
Swift
public let hook: _Hook -
Command specific logger. Has command trigger set as command metadata by default.
Declaration
Swift
public private(set) var logger: Logger { get } -
EventLoop this Command runs on.
Declaration
Swift
public let eventLoop: EventLoop -
Create a new
CommandEventDeclaration
Swift
public init(hooks: SwiftHooks, cmd: _ExecutableCommand, msg: Messageable, for h: _Hook, on loop: EventLoop)Parameters
hooksSwiftHooksinstance dispatching this command.cmdCommand this event is wrapping.
msgMessage that executed the command.
h_Hookthat originally dispatched this command.
View on GitHub
CommandEvent Structure Reference