Class PrivateChannel

java.lang.Object
discord4j.core.object.entity.channel.PrivateChannel
All Implemented Interfaces:
DiscordObject, Channel, MessageChannel, Entity

public final class PrivateChannel extends Object implements MessageChannel
A Discord private channel (also known as a DM channel).
  • Constructor Details

    • PrivateChannel

      public PrivateChannel(GatewayDiscordClient gateway, discord4j.discordjson.json.ChannelData data)
      Constructs an PrivateChannel with an associated GatewayDiscordClient and Discord data.
      Parameters:
      gateway - The GatewayDiscordClient associated to this object, must be non-null.
      data - The raw data as represented by Discord, must be non-null.
  • Method Details

    • getRecipientIds

      public Set<Snowflake> getRecipientIds()
      Gets the IDs of the recipients for this private channel.
      Returns:
      The IDs of the recipients for this private channel.
    • getRecipients

      public Set<User> getRecipients()
      Gets the recipients for this private channel.
      Returns:
      The recipients for this private channel.
    • toString

      public String toString()
    • getClient

      public final GatewayDiscordClient getClient()
      Description copied from interface: DiscordObject
      Returns the GatewayDiscordClient that created this object. Methods in it are exclusively based on the entity cache or Store in use. Refer to calling getClient().rest() to access a DiscordClient that is capable of requesting entities directly from the REST API.
      Specified by:
      getClient in interface DiscordObject
      Returns:
      The GatewayDiscordClient associated to this object.
    • getRestChannel

      public final RestChannel getRestChannel()
      Description copied from interface: Channel
      Return a RestChannel handle to execute REST API operations on this entity.
      Specified by:
      getRestChannel in interface Channel
    • getData

      public final discord4j.discordjson.json.ChannelData getData()
      Description copied from interface: Channel
      Gets the raw data as represented by Discord.
      Specified by:
      getData in interface Channel
      Returns:
      The raw data as represented by Discord.
    • equals

      public final boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object