Class DetachedPrivateChannelImpl
java.lang.Object
net.dv8tion.jda.internal.entities.channel.AbstractChannelImpl<DetachedPrivateChannelImpl>
net.dv8tion.jda.internal.entities.channel.concrete.detached.DetachedPrivateChannelImpl
- All Implemented Interfaces:
Formattable
,Channel
,PrivateChannel
,MessageChannel
,ChannelUnion
,MessageChannelUnion
,IDetachableEntity
,IMentionable
,ISnowflake
,ChannelMixin<DetachedPrivateChannelImpl>
,PrivateChannelMixin<DetachedPrivateChannelImpl>
,MessageChannelMixin<DetachedPrivateChannelImpl>
,IDetachableEntityMixin
public class DetachedPrivateChannelImpl
extends AbstractChannelImpl<DetachedPrivateChannelImpl>
implements PrivateChannel, PrivateChannelMixin<DetachedPrivateChannelImpl>
-
Field Summary
Fields inherited from interface net.dv8tion.jda.api.entities.channel.Channel
MAX_NAME_LENGTH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
canTalk()
Whether the currently logged in user can send messages in this channel or not.void
void
void
void
void
void
void
void
boolean
long
The id for the most recent message sent in this current MessageChannel.getName()
The human readable name of this channel.getType()
TheChannelType
for this channelgetUser()
TheUser
that thisPrivateChannel
communicates with.int
hashCode()
boolean
Whether this entity is detached.setLatestMessageIdLong
(long latestMessageId) Methods inherited from class net.dv8tion.jda.internal.entities.channel.AbstractChannelImpl
asAudioChannel, asCategory, asForumChannel, asGroupChannel, asGuildChannel, asGuildMessageChannel, asMediaChannel, asMessageChannel, asNewsChannel, asPrivateChannel, asStageChannel, asStandardGuildChannel, asStandardGuildMessageChannel, asTextChannel, asThreadChannel, asThreadContainer, asVoiceChannel, getIdLong, getJDA, setName, toString
Methods inherited from interface net.dv8tion.jda.api.entities.channel.Channel
formatTo, getAsMention, getFlags, getJDA
Methods inherited from interface net.dv8tion.jda.internal.entities.channel.mixin.ChannelMixin
delete, setName
Methods inherited from interface net.dv8tion.jda.api.entities.channel.unions.ChannelUnion
asAudioChannel, asCategory, asForumChannel, asGroupChannel, asGuildChannel, asGuildMessageChannel, asMediaChannel, asMessageChannel, asNewsChannel, asPrivateChannel, asStageChannel, asStandardGuildChannel, asStandardGuildMessageChannel, asTextChannel, asThreadChannel, asThreadContainer, asVoiceChannel
Methods inherited from interface net.dv8tion.jda.internal.entities.detached.mixin.IDetachableEntityMixin
checkAttached, detachedRequiresChannelException
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, deleteMessageById, editMessageAttachmentsById, editMessageAttachmentsById, editMessageAttachmentsById, editMessageById, editMessageById, editMessageComponentsById, editMessageComponentsById, editMessageComponentsById, editMessageComponentsById, editMessageComponentsById, editMessageEmbedsById, editMessageEmbedsById, editMessageEmbedsById, editMessageFormatById, editMessageFormatById, endPollById, endPollById, getHistoryAfter, getHistoryAfter, getHistoryAround, getHistoryAround, getHistoryBefore, getHistoryBefore, getLatestMessageId, pinMessageById, purgeMessages, purgeMessagesById, purgeMessagesById, removeReactionById, retrieveMessageById, retrievePollVotersById, retrievePollVotersById, retrieveReactionUsersById, retrieveReactionUsersById, retrieveReactionUsersById, sendFiles, sendMessageComponents, sendMessageComponents, sendMessageFormat, unpinMessageById
Methods inherited from interface net.dv8tion.jda.internal.entities.channel.mixin.middleman.MessageChannelMixin
addReactionById, bulkDeleteMessages, deleteMessageById, editMessageAttachmentsById, editMessageById, editMessageById, editMessageComponentsById, editMessageEmbedsById, getHistory, getHistoryAfter, getHistoryAround, getHistoryBefore, getHistoryFromBeginning, getIterableHistory, pinMessageById, purgeMessages, purgeMessagesById, removeReactionById, retrieveMessageById, retrievePinnedMessages, retrieveReactionUsersById, sendFiles, sendMessage, sendMessage, sendMessageComponents, sendMessageEmbeds, sendMessageEmbeds, sendMessagePoll, sendTyping, unpinMessageById
Methods inherited from interface net.dv8tion.jda.api.entities.channel.unions.MessageChannelUnion
asAudioChannel, asGroupChannel, asGuildMessageChannel, asNewsChannel, asPrivateChannel, asStageChannel, asTextChannel, asThreadChannel, asThreadContainer, asVoiceChannel
Methods inherited from interface net.dv8tion.jda.internal.entities.channel.mixin.concrete.PrivateChannelMixin
retrievePrivateChannel, retrieveUser
-
Constructor Details
-
DetachedPrivateChannelImpl
-
-
Method Details
-
detachedException
- Specified by:
detachedException
in interfaceIDetachableEntityMixin
-
isDetached
public boolean isDetached()Description copied from interface:IDetachableEntity
Whether this entity is detached.If this returns
true
, this entity cannot be retrieved, will never be updated, and most methods that would otherwise return aRestAction
will throw aDetachedEntityException
instead.- Specified by:
isDetached
in interfaceIDetachableEntity
- Returns:
True
, if the entity is detached
-
getType
Description copied from interface:Channel
TheChannelType
for this channel -
getUser
Description copied from interface:PrivateChannel
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)
- This account receives an interaction response, happens when using an user-installed interaction
- This channel represents a DM channel between friends, happens when using an user-installed interaction
In order to retrieve a user that is null, usePrivateChannel.retrieveUser()
- Specified by:
getUser
in interfacePrivateChannel
- Returns:
- Possibly-null
User
. - See Also:
-
getName
Description copied from interface:Channel
The human readable name of this channel.May be an empty string for
GroupChannels
with no name (Group DMs with no name displays the recipients on the Discord client).- Specified by:
getName
in interfaceChannel
- Specified by:
getName
in interfacePrivateChannel
- Specified by:
getName
in interfacePrivateChannelMixin<DetachedPrivateChannelImpl>
- Overrides:
getName
in classAbstractChannelImpl<DetachedPrivateChannelImpl>
- Returns:
- The name of this channel
- See Also:
-
getLatestMessageIdLong
public long getLatestMessageIdLong()Description copied from interface:MessageChannel
The id for the most recent message sent in this current MessageChannel.This value is updated on each
MessageReceivedEvent
and the value might point to an already deleted message since the value is not cleared when the message is deleted, so callingMessageChannel.retrieveMessageById(long)
with this id can result in anUNKNOWN_MESSAGE
error- Specified by:
getLatestMessageIdLong
in interfaceMessageChannel
- Returns:
- The most recent message's id or 0 if no messages are present
-
canTalk
public boolean canTalk()Description copied from interface:MessageChannel
Whether the currently logged in user can send messages in this channel or not.
ForGuildMessageChannel
this method checks for bothPermission.VIEW_CHANNEL
andPermission.MESSAGE_SEND
.
ForThreadChannel
this method checks forPermission.MESSAGE_SEND_IN_THREADS
instead ofPermission.MESSAGE_SEND
.
ForPrivateChannel
this method checks if the user that this PrivateChannel communicates with is not a bot, but it does not check if the said user blocked the currently logged in user or have their DMs disabled.
ForGroupChannel
this method returns false.- Specified by:
canTalk
in interfaceMessageChannel
- Returns:
- True, if we are able to read and send messages in this channel
-
checkCanAccess
public void checkCanAccess()- Specified by:
checkCanAccess
in interfaceChannelMixin<DetachedPrivateChannelImpl>
-
checkCanSendMessage
public void checkCanSendMessage()- Specified by:
checkCanSendMessage
in interfaceMessageChannelMixin<DetachedPrivateChannelImpl>
-
checkCanSendMessageEmbeds
public void checkCanSendMessageEmbeds()- Specified by:
checkCanSendMessageEmbeds
in interfaceMessageChannelMixin<DetachedPrivateChannelImpl>
-
checkCanSendFiles
public void checkCanSendFiles()- Specified by:
checkCanSendFiles
in interfaceMessageChannelMixin<DetachedPrivateChannelImpl>
-
checkCanViewHistory
public void checkCanViewHistory()- Specified by:
checkCanViewHistory
in interfaceMessageChannelMixin<DetachedPrivateChannelImpl>
-
checkCanAddReactions
public void checkCanAddReactions()- Specified by:
checkCanAddReactions
in interfaceMessageChannelMixin<DetachedPrivateChannelImpl>
-
checkCanRemoveReactions
public void checkCanRemoveReactions()- Specified by:
checkCanRemoveReactions
in interfaceMessageChannelMixin<DetachedPrivateChannelImpl>
-
checkCanControlMessagePins
public void checkCanControlMessagePins()- Specified by:
checkCanControlMessagePins
in interfaceMessageChannelMixin<DetachedPrivateChannelImpl>
-
canDeleteOtherUsersMessages
public boolean canDeleteOtherUsersMessages()- Specified by:
canDeleteOtherUsersMessages
in interfaceMessageChannelMixin<DetachedPrivateChannelImpl>
-
setLatestMessageIdLong
- Specified by:
setLatestMessageIdLong
in interfaceMessageChannelMixin<DetachedPrivateChannelImpl>
-
hashCode
public int hashCode() -
equals
-