Class Events.ChatEvent

java.lang.Object
privbot.hooks.Events.ChatEvent
Enclosing class:
Events

public static final class Events.ChatEvent extends Object
A chat line that arrived since the previous tick.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final String
    The message text.
    final String
    The sender's name (may carry server markup), or "" for game messages.
    final boolean
    True when polled from the client's message list; false when forwarded.
    final int
    The game tick it was seen on (-1 when unknown).
    final net.runelite.api.ChatMessageType
    The message type, or null when unknown.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ChatEvent(net.runelite.api.ChatMessageType type, String name, String message, int tick, boolean polled)
    A chat line without a client message-node id (de-duplicated by content within the tick).
    ChatEvent(net.runelite.api.ChatMessageType type, String name, String message, int tick, boolean polled, String key)
    A chat line with a stable identity (sources and tests).
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    contentKey(net.runelite.api.ChatMessageType type, String name, String message, String stamp)
     
    static String
    nodeKey(int nodeId)
     
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • type

      public final net.runelite.api.ChatMessageType type
      The message type, or null when unknown.
    • name

      public final String name
      The sender's name (may carry server markup), or "" for game messages.
    • message

      public final String message
      The message text.
    • tick

      public final int tick
      The game tick it was seen on (-1 when unknown).
    • polled

      public final boolean polled
      True when polled from the client's message list; false when forwarded.
  • Constructor Details

    • ChatEvent

      public ChatEvent(net.runelite.api.ChatMessageType type, String name, String message, int tick, boolean polled)
      A chat line without a client message-node id (de-duplicated by content within the tick).
      Parameters:
      type - message type, or null
      name - sender
      message - text
      tick - game tick
      polled - whether it was polled
    • ChatEvent

      public ChatEvent(net.runelite.api.ChatMessageType type, String name, String message, int tick, boolean polled, String key)
      A chat line with a stable identity (sources and tests).
      Parameters:
      type - message type, or null
      name - sender
      message - text
      tick - game tick
      polled - whether it was polled
      key - stable identity (nodeKey(int) / contentKey(net.runelite.api.ChatMessageType, java.lang.String, java.lang.String, java.lang.String)), or null to derive one from the content and tick
  • Method Details

    • nodeKey

      public static String nodeKey(int nodeId)
      Parameters:
      nodeId - the client's message-node id
      Returns:
      the de-duplication key for that node
    • contentKey

      public static String contentKey(net.runelite.api.ChatMessageType type, String name, String message, String stamp)
      Parameters:
      type - message type
      name - sender
      message - text
      stamp - something stable for this line (its timestamp)
      Returns:
      the de-duplication key for content plus a stamp
    • toString

      public String toString()
      Overrides:
      toString in class Object