Skip to content

feat: voice channel status - #2419

Open
HTGAzureX1212 wants to merge 8 commits into
twilight-rs:mainfrom
TeamHarTex:HTGAzureX1212/voice-channel-status
Open

feat: voice channel status#2419
HTGAzureX1212 wants to merge 8 commits into
twilight-rs:mainfrom
TeamHarTex:HTGAzureX1212/voice-channel-status

Conversation

@HTGAzureX1212

Copy link
Copy Markdown
Member

Corresponding Discord API Documentation PR(s): discord/discord-api-docs#6400 and discord/discord-api-docs#6398

@HTGAzureX1212 HTGAzureX1212 self-assigned this Feb 13, 2025
@github-actions github-actions Bot added c-http Affects the http crate c-http-ratelimiting Affects the http ratelimiting crate c-model Affects the model crate c-validate Affects the validate crate t-feature Addition of a new feature labels Feb 13, 2025
@github-actions github-actions Bot added the c-cache Affects the cache crate label Feb 13, 2025
@HTGAzureX1212 HTGAzureX1212 changed the title feat(http, http-ratelimiting, model, validate): voice channel status feat(cache, http, http-ratelimiting, model, validate): voice channel status Feb 13, 2025
@HTGAzureX1212 HTGAzureX1212 changed the title feat(cache, http, http-ratelimiting, model, validate): voice channel status feat(cache, http, model, ratelimit, validate): voice channel status Feb 13, 2025
@github-actions github-actions Bot added the c-gateway Affects the gateway crate label Feb 13, 2025
@HTGAzureX1212 HTGAzureX1212 changed the title feat(cache, http, model, ratelimit, validate): voice channel status feat(cache, gateway, http, model, ratelimit, validate): voice channel status Feb 13, 2025
@github-actions github-actions Bot added the c-standby Affects the standby crate label Feb 13, 2025
@HTGAzureX1212 HTGAzureX1212 changed the title feat(cache, gateway, http, model, ratelimit, validate): voice channel status feat(cache, gateway, http, model, ratelimit, standby, validate): voice channel status Feb 13, 2025
@HTGAzureX1212 HTGAzureX1212 changed the title feat(cache, gateway, http, model, ratelimit, standby, validate): voice channel status feat(all \ {gateway-queue, lavalink, mention, util}): voice channel status Feb 13, 2025
@Erk- Erk- added d-not-deployed Discord API change that hasn't been deployed to the docs. w-do-not-merge PR is blocked or deferred labels Feb 13, 2025
@HTGAzureX1212 HTGAzureX1212 removed d-not-deployed Discord API change that hasn't been deployed to the docs. w-do-not-merge PR is blocked or deferred labels May 1, 2026
/// Current user's profile has been updated.
const USER_UPDATE = 1 << 41;
/// A voice channel status has been updated.
const VOICE_CHANNEL_STATUS_UPDATE = 1 << 79;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has since been used and a new bit will have to be used.


/// Sets the status of a voice channel.
#[must_use = "requests must be configured and executed"]
pub struct SetVoiceChannelStatus<'a> {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +35 to +43
pub fn status(mut self, status: &'a str) -> Self {
self.fields = self.fields.and_then(|mut fields| {
validate_status(status)?;
fields.status.replace(status);

Ok(fields)
});

self

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

status is documented as a required field consisting of a nullable string. This should be in new and should be Option<&'a str>. If the user doesn't call this method then the response should be a 400.

) -> SetVoiceChannelStatus<'_> {
SetVoiceChannelStatus::new(self, channel_id)
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's ultimately no real organizational scheme to client method ordering, but would this make more sense somewhere around update_channel and its related methods?

Comment on lines +14 to +15
#[serde(skip_serializing_if = "Option::is_none")]
status: Option<&'a str>,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment below. If None then this should serialize as null

Suggested change
#[serde(skip_serializing_if = "Option::is_none")]
status: Option<&'a str>,
status: Option<&'a str>,

@raventhyme raventhyme changed the title feat(all \ {gateway-queue, lavalink, mention, util}): voice channel status feat: voice channel status Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c-cache Affects the cache crate c-gateway Affects the gateway crate c-http Affects the http crate c-http-ratelimiting Affects the http ratelimiting crate c-model Affects the model crate c-standby Affects the standby crate c-validate Affects the validate crate t-feature Addition of a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants