Add voice channel statuses#312
Conversation
This commit implements the new permissions (USE_CLYDE_AI, SET_VOICE_CHANNEL_STATUS, and CREATE_GUILD_EXPRESSIONS) as seen in these PRs: discord/discord-api-docs#6354 discord/discord-api-docs#6398 discord/discord-api-docs#6120
|
You have the commit about adding the new permissions in this PR as well by accident. |
|
Intentional; it'll be absolved when #311 is merged. |
|
Seems like we will get a new endpoint for setting the voice channel status: discord/discord-api-docs#6400 |
|
Yeah oops, don't know why I did it like this when I literally linked the PR haha. |
Co-authored-by: MazeXP <26042705+MazeXP@users.noreply.github.com>
| CancellationToken ct = default | ||
| ) | ||
| { | ||
| return this.RestHttpClient.PatchAsync |
There was a problem hiding this comment.
This doesn't exist on the non-generic methods it seems. cc @Nihlus
| Optional<IReadOnlyList<Snowflake>> appliedTags = default, | ||
| Optional<SortOrder> defaultSortOrder = default, | ||
| Optional<ForumLayout> defaultForumLayout = default, | ||
| Optional<string?> status = default, |
There was a problem hiding this comment.
ModifyChannelAsync should not be modified as it is not meant to be used for setting the voice channel status by documentation
There was a problem hiding this comment.
I swear I removed that. Bwah
There was a problem hiding this comment.
dw, there are many Modify...Channel calls
| CancellationToken ct = default | ||
| ) | ||
| { | ||
| return this.RestHttpClient.PatchAsync |
There was a problem hiding this comment.
Add the check about status length here
|
Please rebase this PR as well - there are now merge conflicts, and the new inspection support should catch a couple of issues in the code. Merging is blocked by Discord not having merged the corresponding PRs fow now. |
0d20410 to
0a22fc8
Compare
# Conflicts: # Backend/Remora.Discord.API.Abstractions/API/Objects/Permissions/DiscordPermission.cs
47b48b7 to
ebbc19d
Compare
| /// <summary> | ||
| /// Gets the ID of the channel being updated. | ||
| /// </summary> | ||
| Snowflake ID { get; } |
Check notice
Code scanning / InspectCode
Type member is never used: Non-private accessibility
| /// <summary> | ||
| /// Gets the ID of the guild. | ||
| /// </summary> | ||
| Snowflake GuildID { get; } |
Check notice
Code scanning / InspectCode
Type member is never used: Non-private accessibility
| /// <summary> | ||
| /// Gets the new status of the voice channel. | ||
| /// </summary> | ||
| Optional<string> Status { get; } |
Check notice
Code scanning / InspectCode
Type member is never used: Non-private accessibility
| namespace Remora.Discord.API.Gateway.Events.Channels; | ||
|
|
||
| /// <inheritdoc cref="Remora.Discord.API.Abstractions.Gateway.Events.IVoiceChannelStatusUpdate"/> | ||
| public record VoiceChannelStatusUpdate |
Check notice
Code scanning / InspectCode
Type is never used: Non-private accessibility
| CancellationToken ct = default | ||
| ) | ||
| { | ||
| if (status is { HasValue: true, Value: { Length: > 500 } }) |
Check notice
Code scanning / InspectCode
Merge nested property patterns
| return this.RestHttpClient.PatchAsync | ||
| ( | ||
| $"channels/{channelID}/voice-status", | ||
| b => b.WithJson(b => b.Write("status", status, this.JsonOptions)).WithRateLimitContext(this.RateLimitCache), |
Check warning
Code scanning / InspectCode
Variable in local function hides variable from outer scope
As it says on the tin; see also discord/discord-api-docs#6398 (this requires merging #311 first)