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 boolean canEqual​(java.lang.Object other)  
    boolean equals​(java.lang.Object o)  
    java.lang.String getCommand()
    Command
    java.lang.String getCommandPrefix()
    Command Prefix
    java.util.Set<com.github.twitch4j.common.enums.CommandPermission> getPermissions()
    Permissions of the user
    CommandSource getSource()
    Source: channel / privateMessage
    java.lang.String getSourceId()
    Source Id: channelName or userName
    com.github.twitch4j.common.events.domain.EventUser getUser()
    User
    int hashCode()  
    void respondToUser​(java.lang.String message)
    Respond to the command origin (channel or private)
    java.lang.String 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

    Methods 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:
      toString in class TwitchEvent
    • getSource

      public CommandSource 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:
      equals in class TwitchEvent
    • canEqual

      protected boolean canEqual​(java.lang.Object other)
      Overrides:
      canEqual in class TwitchEvent
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class TwitchEvent