Package net.dv8tion.jda.api.entities
Interface PrivateChannel
-
- All Superinterfaces:
Channel,Formattable,IMentionable,ISnowflake,MessageChannel
public interface PrivateChannel extends MessageChannel
Represents the connection used for direct messaging.- See Also:
User.openPrivateChannel()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetName()The human-readable name of this channel.UsergetUser()TheUserthat thisPrivateChannelcommunicates with.RestAction<User>retrieveUser()Retrieves theUserthat thisPrivateChannelcommunicates with.-
Methods inherited from interface net.dv8tion.jda.api.entities.Channel
delete, formatTo, getAsMention, getJDA, getType
-
Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreated
-
Methods inherited from interface net.dv8tion.jda.api.entities.MessageChannel
addReactionById, addReactionById, addReactionById, addReactionById, canTalk, deleteMessageById, deleteMessageById, editMessageById, editMessageById, editMessageById, editMessageById, editMessageComponentsById, editMessageComponentsById, editMessageComponentsById, editMessageComponentsById, editMessageEmbedsById, editMessageEmbedsById, editMessageEmbedsById, editMessageEmbedsById, editMessageFormatById, editMessageFormatById, getHistory, getHistoryAfter, getHistoryAfter, getHistoryAfter, getHistoryAround, getHistoryAround, getHistoryAround, getHistoryBefore, getHistoryBefore, getHistoryBefore, getHistoryFromBeginning, getIterableHistory, getLatestMessageId, getLatestMessageIdLong, pinMessageById, pinMessageById, purgeMessages, purgeMessages, purgeMessagesById, purgeMessagesById, purgeMessagesById, removeReactionById, removeReactionById, removeReactionById, removeReactionById, retrieveMessageById, retrieveMessageById, retrievePinnedMessages, retrieveReactionUsersById, retrieveReactionUsersById, retrieveReactionUsersById, retrieveReactionUsersById, sendFile, sendFile, sendFile, sendFile, sendMessage, sendMessage, sendMessageEmbeds, sendMessageEmbeds, sendMessageFormat, sendTyping, unpinMessageById, unpinMessageById
-
-
-
-
Method Detail
-
getUser
@Nullable User getUser()
TheUserthat thisPrivateChannelcommunicates 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()
-
retrieveUser
@Nonnull @CheckReturnValue RestAction<User> retrieveUser()
Retrieves theUserthat thisPrivateChannelcommunicates with.
This method fetches the channel from the API and retrieves the User from that.- Returns:
- A
RestActionto retrieve theUserthat thisPrivateChannelcommunicates with.
-
getName
@Nonnull String 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 whengetUser()is null, and the reasons are given ingetUser()If the channel name is important,retrieveUser()should be used, instead.- Specified by:
getNamein interfaceChannel- Returns:
- The name of this channel
- See Also:
retrieveUser(),getUser()
-
-