Interface PrivateChannel
- All Superinterfaces:
Channel
,Formattable
,IMentionable
,ISnowflake
,MessageChannel
Represents the connection used for direct messaging.
- See Also:
-
Field Summary
Fields inherited from interface net.dv8tion.jda.api.entities.channel.Channel
MAX_NAME_LENGTH
-
Method Summary
Modifier and TypeMethodDescriptiongetName()
The human-readable name of this channel.getUser()
TheUser
that thisPrivateChannel
communicates with.Retrieves theUser
that thisPrivateChannel
communicates with.Methods inherited from interface net.dv8tion.jda.api.entities.channel.Channel
delete, formatTo, getAsMention, getFlags, getJDA, getType
Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreated
Methods inherited from interface net.dv8tion.jda.api.entities.channel.middleman.MessageChannel
addReactionById, addReactionById, canTalk, deleteMessageById, deleteMessageById, editMessageAttachmentsById, editMessageAttachmentsById, editMessageAttachmentsById, editMessageAttachmentsById, editMessageById, editMessageById, editMessageById, editMessageById, editMessageComponentsById, editMessageComponentsById, editMessageComponentsById, editMessageComponentsById, editMessageEmbedsById, editMessageEmbedsById, editMessageEmbedsById, editMessageEmbedsById, editMessageFormatById, editMessageFormatById, endPollById, endPollById, getHistory, getHistoryAfter, getHistoryAfter, getHistoryAfter, getHistoryAround, getHistoryAround, getHistoryAround, getHistoryBefore, getHistoryBefore, getHistoryBefore, getHistoryFromBeginning, getIterableHistory, getLatestMessageId, getLatestMessageIdLong, pinMessageById, pinMessageById, purgeMessages, purgeMessages, purgeMessagesById, purgeMessagesById, purgeMessagesById, removeReactionById, removeReactionById, retrieveMessageById, retrieveMessageById, retrievePinnedMessages, retrievePollVotersById, retrievePollVotersById, retrieveReactionUsersById, retrieveReactionUsersById, sendFiles, sendFiles, sendMessage, sendMessage, sendMessageComponents, sendMessageComponents, sendMessageEmbeds, sendMessageEmbeds, sendMessageFormat, sendMessagePoll, sendTyping, unpinMessageById, unpinMessageById
-
Method Details
-
getUser
TheUser
that thisPrivateChannel
communicates with.This user is only null if this channel is currently uncached, and one the following occur:
- A reaction is removed
- A reaction is added
- A message is deleted
- This account sends a message to a user from another shard (not shard 0)
In order to retrieve a user that is null, useretrieveUser()
- Returns:
- Possibly-null
User
. - See Also:
-
retrieveUser
Retrieves theUser
that thisPrivateChannel
communicates with.
This method fetches the channel from the API and retrieves the User from that.- Returns:
- A
RestAction
to retrieve theUser
that thisPrivateChannel
communicates with.
-
getName
The human-readable name of this channel.If getUser returns null, this method will return an empty String. This happens when JDA does not have enough information to populate the channel name.
This will occur only when
getUser()
is null, and the reasons are given ingetUser()
If the channel name is important,
retrieveUser()
should be used, instead.
-