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 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

      public void respondToUser(String message)
      Respond to the command origin (channel or private)
      Parameters:
      message - Message
    • toString

      public String toString()
      Overrides:
      toString in class TwitchEvent
    • getSource

      public CommandSource getSource()
      Source: channel / privateMessage
    • getSourceId

      public String getSourceId()
      Source Id: channelName or userName
    • getUser

      public EventUser getUser()
      User
    • getCommandPrefix

      public String getCommandPrefix()
      Command Prefix
    • getCommand

      public String getCommand()
      Command
    • getPermissions

      public Set<CommandPermission> getPermissions()
      Permissions of the user
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class TwitchEvent
    • canEqual

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class TwitchEvent
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class TwitchEvent