You are reading the documentation for the next version of discord.js. Documentation for v13/v14+ has been moved to old.discordjs.dev

IPubSubBroker

export declare interface IPubSubBroker<TEvents extends Record<string, any>> extends IBaseBroker<TEvents>, AsyncEventEmitter<ToEventMap<TEvents>>
export declare interface IPubSubBroker<TEvents extends Record<string, any>> extends IBaseBroker<TEvents>, AsyncEventEmitter<ToEventMap<TEvents>>

No summary provided.

Extends

IBaseBroker<TEvents>AsyncEventEmitter<ToEventMap<TEvents>>
NameConstraintsOptionalDefaultDescription
TEventsRecord<string, any>NoNone
publish(event, data):Promise<void>
Publishes an event
NameTypeOptionalDescription
eventTNoNone
dataTEvents[T]NoNone
subscribe(group, events):Promise<void>
Subscribes to the given events, grouping them by the given group name
NameTypeOptionalDescription
groupstringNoNone
events(keyof TEvents)[]NoNone
Inherited from IBaseBroker
unsubscribe(group, events):Promise<void>
Unsubscribes from the given events - it's required to pass the same group name as when subscribing for proper cleanup
NameTypeOptionalDescription
groupstringNoNone
events(keyof TEvents)[]NoNone
Inherited from IBaseBroker