GlobalListener
public struct GlobalListener<T, I> : EventListeners where T : _GEvent, I == T.ContentType
Listener used to listen to global events.
Listener(Global.messageCreate) { ... }
-
Create new
GlobalListener
.Declaration
Swift
public init(_ event: T, _ closure: @escaping EventHandler<GlobalDispatch, I>)
Parameters
event
GlobalEvent to listen for.
closure
Closure to invoke when receiving event
T
. -
Declaration
Swift
public init(_ event: T, _ closure: @escaping SyncEventHandler<GlobalDispatch, I>)
-
Declaration
Swift
public func register(to h: SwiftHooks)
-
Declaration
Swift
public func register(to h: _Hook)