When
eventStarts()
Be notified when the event starts.
The callback is not called if the user joins the event after the start.
usage:
When.eventStarts(() => {
// do something
})
Param | Type | Description |
---|---|---|
callback | Function | A function to be called whenever the event is triggered |
eventEnds()
Be notified when the event ends.
The callback is not called if the user joins the event after the end.
usage:
When.eventEnds(() => {
// do something
})
Param | Type | Description |
---|---|---|
callback | Function | A function to be called whenever the event is triggered |
userJoins()
Be notified when someone joins the event.
The callback is not called if the user joins the event after the end.
usage:
When.userJoins((user) => {
// do something with the 'user' object
})
Param | Type | Description |
---|---|---|
callback | Function | A function to be called whenever a user joins |
userLeaves()
Be notified when someone leaves the event.
The callback is not called if the user leaves the event after the end.
usage:
When.userLeaves((user) => {
// do something with the 'user' object
})
Param | Type | Description |
---|---|---|
callback | Function | A function to be called whenever a user leaves |
currentUserMutesNotifications()
Be notified when the current user mutes/unmutes the notifications.
usage:
When.currentUserMutesNotifications( ({ muted }) => {
// do something such as disable notifications of the plugin if muted
})
Param | Type | Description |
---|---|---|
callback | Function | A function to be called whenever the current user mutes or unmutes the notifications |
Updated 10 months ago