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
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 Summary
ConstructorDescriptionUserTypingEvent
(JDA api, long responseNumber, User user, MessageChannel channel, OffsetDateTime timestamp, Member member) -
Method Summary
Modifier and TypeMethodDescriptionThe channel where the typing was startedgetGuild()
Guild
in which this users started typing, ornull
if this was not in a Guild.Member
instance for the User, or null if this was not in a Guild.NewsChannel
in which this users started typing, ornull
if this was not in a NewsChannel.PrivateChannel
in which this users started typing, ornull
if this was not in a PrivateChannel.TextChannel
in which this users started typing, ornull
if this was not in a TextChannel.The time when the user started typinggetType()
TheChannelType
boolean
isFromType
(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 Details
-
UserTypingEvent
public UserTypingEvent(@Nonnull JDA api, long responseNumber, @Nonnull User user, @Nonnull MessageChannel channel, @Nonnull OffsetDateTime timestamp, @Nullable Member member)
-
-
Method Details
-
getTimestamp
The time when the user started typing- Returns:
- The time when the typing started
-
getChannel
The channel where the typing was started- Returns:
- The channel
-
isFromType
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
TheChannelType
- Returns:
- The
ChannelType
-
getPrivateChannel
PrivateChannel
in which this users started typing, ornull
if this was not in a PrivateChannel.- Returns:
- Possibly-null
PrivateChannel
-
getTextChannel
TextChannel
in which this users started typing, ornull
if this was not in a TextChannel.- Returns:
- Possibly-null
TextChannel
-
getNewsChannel
NewsChannel
in which this users started typing, ornull
if this was not in a NewsChannel.- Returns:
- Possibly-null
NewsChannel
-
getGuild
Guild
in which this users started typing, ornull
if this was not in a Guild.- Returns:
- Possibly-null
Guild
-
getMember
Member
instance for the User, or null if this was not in a Guild.- Returns:
- Possibly-null
Member
-