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
public final class CommandEvent extends TwitchEvent
This event gets called when a message is received in a channel.
-
Constructor Summary
Constructors Constructor Description CommandEvent(CommandSource source, java.lang.String sourceId, com.github.twitch4j.common.events.domain.EventUser user, java.lang.String commandPrefix, java.lang.String command, java.util.Set<com.github.twitch4j.common.enums.CommandPermission> permissions)Event Constructor -
Method Summary
Modifier and Type Method Description protected booleancanEqual(java.lang.Object other)booleanequals(java.lang.Object o)java.lang.StringgetCommand()Commandjava.lang.StringgetCommandPrefix()Command Prefixjava.util.Set<com.github.twitch4j.common.enums.CommandPermission>getPermissions()Permissions of the userCommandSourcegetSource()Source: channel / privateMessagejava.lang.StringgetSourceId()Source Id: channelName or userNamecom.github.twitch4j.common.events.domain.EventUsergetUser()UserinthashCode()voidrespondToUser(java.lang.String message)Respond to the command origin (channel or private)java.lang.StringtoString()Methods inherited from class com.github.twitch4j.chat.events.TwitchEvent
getTwitchChatMethods inherited from class com.github.philippheuer.events4j.core.domain.Event
getEventId, getFiredAt, getFiredAtInstant, getServiceMediator, setEventId, setFiredAt, setFiredAtInstant, setServiceMediatorMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
CommandEvent
public CommandEvent(CommandSource source, java.lang.String sourceId, com.github.twitch4j.common.events.domain.EventUser user, java.lang.String commandPrefix, java.lang.String command, java.util.Set<com.github.twitch4j.common.enums.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
public void respondToUser(java.lang.String message)Respond to the command origin (channel or private)- Parameters:
message- Message
-
toString
public java.lang.String toString()- Overrides:
toStringin classTwitchEvent
-
getSource
Source: channel / privateMessage -
getSourceId
public java.lang.String getSourceId()Source Id: channelName or userName -
getUser
public com.github.twitch4j.common.events.domain.EventUser getUser()User -
getCommandPrefix
public java.lang.String getCommandPrefix()Command Prefix -
getCommand
public java.lang.String getCommand()Command -
getPermissions
public java.util.Set<com.github.twitch4j.common.enums.CommandPermission> getPermissions()Permissions of the user -
equals
public boolean equals(java.lang.Object o)- Overrides:
equalsin classTwitchEvent
-
canEqual
protected boolean canEqual(java.lang.Object other)- Overrides:
canEqualin classTwitchEvent
-
hashCode
public int hashCode()- Overrides:
hashCodein classTwitchEvent
-