Skip to main content

PrivateMessageEvent

Description

The PrivateMessageEvent is triggered for private messages / whispers and can be triggered from PubSub or Chat.

Dependencies

Requires the TwitchChat Module to be enabled and active for the source channel. See TwitchChat. Otherwise you will need to enable PubSub and subscribe to the whispers topic the receive PrivateMessageEvents.

Examples

Listen for PrivateMessageEvent

eventManager.onEvent(PrivateMessageEvent.class, event -> {
System.out.println("[Whisper] " + event.getUser().getName() + ": " + event.getMessage());
});