-
Notifications
You must be signed in to change notification settings - Fork 48
Add voice channel statuses #312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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. |
MazeXP
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM just a minor change
...end/Remora.Discord.API.Abstractions/API/Gateway/Events/Channels/IVoiceChannelStatusUpdate.cs
Outdated
Show resolved
Hide resolved
|
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. |
| CancellationToken ct = default | ||
| ) | ||
| { | ||
| return this.RestHttpClient.PatchAsync |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing AddAuditReason call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I swear I removed that. Bwah
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dw, there are many Modify...Channel calls
| CancellationToken ct = default | ||
| ) | ||
| { | ||
| return this.RestHttpClient.PatchAsync |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)