CommandEvent
public struct CommandEvent
Event passed in to a command closure containing required data.
-
Refference to
SwiftHooks
instance 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
CommandEvent
Declaration
Swift
public init(hooks: SwiftHooks, cmd: _ExecutableCommand, msg: Messageable, for h: _Hook, on loop: EventLoop)
Parameters
hooks
SwiftHooks
instance dispatching this command.cmd
Command this event is wrapping.
msg
Message that executed the command.
h
_Hook
that originally dispatched this command.