Class VoiceChannel

java.lang.Object
discord4j.core.object.entity.channel.VoiceChannel
All Implemented Interfaces:
DiscordObject, AudioChannel, CategorizableChannel, Channel, GuildChannel, GuildMessageChannel, MessageChannel, TopLevelGuildChannel, TopLevelGuildMessageChannel, Entity

public final class VoiceChannel extends Object implements AudioChannel, TopLevelGuildMessageChannel
A Discord voice channel.
  • Constructor Details

    • VoiceChannel

      public VoiceChannel(GatewayDiscordClient gateway, discord4j.discordjson.json.ChannelData data)
      Constructs an VoiceChannel 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

    • getUserLimit

      public int getUserLimit()
      Gets the user limit of this voice channel.
      Returns:
      The user limit of this voice channel.
    • getVideoQualityMode

      public VoiceChannel.Mode getVideoQualityMode()
      Gets the camera video quality mode of the voice channel.
      Returns:
      The camera video quality mode of the voice channel.
    • edit

      Deprecated.
      use edit(VoiceChannelEditSpec) or edit() which offer an immutable approach to build specs
      Requests to edit a voice channel.
      Parameters:
      spec - A Consumer that provides a "blank" LegacyVoiceChannelEditSpec to be operated on.
      Returns:
      A Mono where, upon successful completion, emits the edited VoiceChannel. If an error is received, it is emitted through the Mono.
    • edit

      public discord4j.core.spec.VoiceChannelEditMono edit()
      Requests to edit this voice channel. Properties specifying how to edit this voice channel can be set via the withXxx methods of the returned VoiceChannelEditMono.
      Returns:
      A VoiceChannelEditMono where, upon successful completion, emits the edited VoiceChannel. If an error is received, it is emitted through the VoiceChannelEditMono.
    • edit

      public Mono<VoiceChannel> edit(discord4j.core.spec.VoiceChannelEditSpec spec)
      Requests to edit this voice channel.
      Parameters:
      spec - an immutable object that specifies how to edit this voice channel
      Returns:
      A Mono where, upon successful completion, emits the edited VoiceChannel. If an error is received, it is emitted through the Mono.
    • toString

      public String toString()
    • getEffectivePermissions

      public Mono<PermissionSet> getEffectivePermissions(Snowflake memberId)
      Description copied from interface: GuildChannel
      Gets the permissions for the given member, taking into account permission overwrites in this channel.
      Specified by:
      getEffectivePermissions in interface GuildChannel
      Parameters:
      memberId - The ID of the member to get permissions for.
      Returns:
      The permissions for the given member.
    • getEffectivePermissions

      public Mono<PermissionSet> getEffectivePermissions(Member member)
      Description copied from interface: GuildChannel
      Gets the permissions for the given member, taking into account permission overwrites in this channel.
      Specified by:
      getEffectivePermissions in interface GuildChannel
      Parameters:
      member - The member to get permissions for.
      Returns:
      The permissions for the given member.
    • 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