Class UserTypingEvent

All Implemented Interfaces:
GenericEvent

public class UserTypingEvent extends GenericUserEvent
Indicates that a User started typing. (Similar to the typing indicator in the Discord client)

Requirements

This event requires the GUILD_MESSAGE_TYPING intent to be enabled to fire for guild channels, and DIRECT_MESSAGE_TYPING to fire for private channels.
createDefault(String) and createLight(String) disable these by default!

Can be used to retrieve the User who started typing and when and in which MessageChannel they started typing.

  • Constructor Details

  • Method Details

    • getTimestamp

      @Nonnull public OffsetDateTime getTimestamp()
      The time when the user started typing
      Returns:
      The time when the typing started
    • getChannel

      @Nonnull public MessageChannelUnion getChannel()
      The channel where the typing was started
      Returns:
      The channel
    • isFromType

      public boolean isFromType(@Nonnull ChannelType type)
      Whether the user started typing in a channel of the specified type.
      Parameters:
      type - ChannelType
      Returns:
      True, if the user started typing in a channel of the specified type
    • getType

      @Nonnull public ChannelType getType()
      Returns:
      The ChannelType
    • getGuild

      @Nullable public Guild getGuild()
      Guild in which this users started typing, or null if this was not in a Guild.
      Returns:
      Possibly-null Guild
    • getMember

      @Nullable public Member getMember()
      Member instance for the User, or null if this was not in a Guild.
      Returns:
      Possibly-null Member