Package net.dv8tion.jda.api.events.user
Class UserTypingEvent
- java.lang.Object
-
- net.dv8tion.jda.api.events.Event
-
- net.dv8tion.jda.api.events.user.GenericUserEvent
-
- net.dv8tion.jda.api.events.user.UserTypingEvent
-
- All Implemented Interfaces:
GenericEvent
public class UserTypingEvent extends GenericUserEvent
Indicates that aUserstarted typing. (Similar to the typing indicator in the Discord client)Requirements
This event requires the
GUILD_MESSAGE_TYPINGintent to be enabled to fire for guild channels, andDIRECT_MESSAGE_TYPINGto fire for private channels.createDefault(String)andcreateLight(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 Summary
Constructors Constructor Description UserTypingEvent(JDA api, long responseNumber, User user, MessageChannel channel, java.time.OffsetDateTime timestamp, Member member)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MessageChannelgetChannel()The channel where the typing was startedGuildgetGuild()Guildin which this users started typing, ornullif this was not in a Guild.MembergetMember()Memberinstance for the User, or null if this was not in a Guild.PrivateChannelgetPrivateChannel()PrivateChannelin which this users started typing, ornullif this was not in a PrivateChannel.TextChannelgetTextChannel()TextChannelin which this users started typing, ornullif this was not in a TextChannel.java.time.OffsetDateTimegetTimestamp()The time when the user started typingChannelTypegetType()TheChannelTypebooleanisFromType(ChannelType type)Whether the user started typing in a channel of the specified type.-
Methods inherited from class net.dv8tion.jda.api.events.user.GenericUserEvent
getUser
-
Methods inherited from class net.dv8tion.jda.api.events.Event
getJDA, getResponseNumber
-
-
-
-
Constructor Detail
-
UserTypingEvent
public UserTypingEvent(@Nonnull JDA api, long responseNumber, @Nonnull User user, @Nonnull MessageChannel channel, @Nonnull java.time.OffsetDateTime timestamp, @Nullable Member member)
-
-
Method Detail
-
getTimestamp
@Nonnull public java.time.OffsetDateTime getTimestamp()
The time when the user started typing- Returns:
- The time when the typing started
-
getChannel
@Nonnull public MessageChannel 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()
TheChannelType- Returns:
- The
ChannelType
-
getPrivateChannel
@Nullable public PrivateChannel getPrivateChannel()
PrivateChannelin which this users started typing, ornullif this was not in a PrivateChannel.- Returns:
- Possibly-null
PrivateChannel
-
getTextChannel
@Nullable public TextChannel getTextChannel()
TextChannelin which this users started typing, ornullif this was not in a TextChannel.- Returns:
- Possibly-null
TextChannel
-
getGuild
@Nullable public Guild getGuild()
Guildin which this users started typing, ornullif this was not in a Guild.- Returns:
- Possibly-null
Guild
-
-