REST API endpoints for voice: regions, and voice states in Stage channels.
All functions return raw maps: {:ok, map} or {:error, reason}. Joining and leaving voice
goes through the gateway — see EDA.Voice.
Summary
Functions
Changes a voice state in a Stage channel: the bot's own with :me, or a user's.
Lists the voice regions a voice or Stage channel's rtc_region can be set to.
Gets a voice state in a guild: the bot's own with :me, or a user's.
Functions
@spec modify_voice_state( String.t() | integer(), :me | String.t() | integer(), keyword() ) :: :ok | {:error, term()}
Changes a voice state in a Stage channel: the bot's own with :me, or a user's.
PATCH /guilds/{guild_id}/voice-states/@me or /{user_id}. Discord only allows this in a
Stage channel the user has already joined, so :channel_id must be that Stage channel.
Options
:channel_id— the Stage channel the user is in (required by Discord):suppress—falseto move the user to the speakers,trueback to the audience. Unsuppressing needsMUTE_MEMBERS; the bot can always suppress itself:request_to_speak_timestamp—:meonly: raise the bot's hand, as aDateTimeor an ISO8601 string (now or later), ornilto lower it. NeedsREQUEST_TO_SPEAK
Example
# Put the bot on stage
EDA.API.Voice.modify_voice_state(guild_id, :me, channel_id: stage_id, suppress: false)
Lists the voice regions a voice or Stage channel's rtc_region can be set to.
GET /voice/regions. EDA.API.Guild.voice_regions/1 adds a guild's VIP regions.
@spec voice_state(String.t() | integer(), :me | String.t() | integer()) :: {:ok, map()} | {:error, term()}
Gets a voice state in a guild: the bot's own with :me, or a user's.
GET /guilds/{guild_id}/voice-states/@me or /voice-states/{user_id}. Answers 404 when the
user is not in a voice channel of that guild.