Package com.github.twitch4j.chat.events
Class CommandEvent
java.lang.Object
com.github.philippheuer.events4j.core.domain.Event
com.github.twitch4j.chat.events.TwitchEvent
com.github.twitch4j.chat.events.CommandEvent
- All Implemented Interfaces:
com.github.philippheuer.events4j.api.domain.IEvent
This event gets called when a message is received in a channel.
-
Constructor Summary
ConstructorDescriptionCommandEvent
(CommandSource source, String sourceId, EventUser user, String commandPrefix, String command, Set<CommandPermission> permissions) Event Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
CommandCommand PrefixPermissions of the userSource: channel / privateMessageSource Id: channelName or userNamegetUser()
Userint
hashCode()
void
respondToUser
(String message) Respond to the command origin (channel or private)toString()
Methods inherited from class com.github.twitch4j.chat.events.TwitchEvent
getTwitchChat
Methods inherited from class com.github.philippheuer.events4j.core.domain.Event
getEventId, getFiredAt, getFiredAtInstant, getServiceMediator, setEventId, setFiredAt, setFiredAtInstant, setServiceMediator
-
Constructor Details
-
CommandEvent
public CommandEvent(CommandSource source, String sourceId, EventUser user, String commandPrefix, String command, Set<CommandPermission> permissions) Event Constructor- Parameters:
source
- Source (used for response method)sourceId
- Source Id (used for response method)user
- The user who triggered the event.commandPrefix
- The command prefix used.command
- The plain command without prefix.permissions
- The permissions of the triggering user.
-
-
Method Details
-
respondToUser
Respond to the command origin (channel or private)- Parameters:
message
- Message
-
toString
- Overrides:
toString
in classTwitchEvent
-
getSource
Source: channel / privateMessage -
getSourceId
Source Id: channelName or userName -
getUser
User -
getCommandPrefix
Command Prefix -
getCommand
Command -
getPermissions
Permissions of the user -
equals
- Overrides:
equals
in classTwitchEvent
-
canEqual
- Overrides:
canEqual
in classTwitchEvent
-
hashCode
public int hashCode()- Overrides:
hashCode
in classTwitchEvent
-