Conversation
|
The documentation preview is available at https://preview.netcord.dev/297. |
There was a problem hiding this comment.
Pull request overview
Adds REST support for “community invite” target-user management by introducing new invite properties, upload/download endpoints, and a job-status model, wired into the source-generated JSON serialization context.
Changes:
- Add REST client endpoints to fetch, update, and check job status for invite target users.
- Extend
InvitePropertiesto support multipart payloads (JSON + target users file) and addrole_ids. - Introduce models for invite target user job status and a streaming file serializer for user IDs.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| NetCord/Serialization.cs | Registers the new JSON model in the source-generated serializer context. |
| NetCord/Rest/RestClient.Invite.cs | Adds invite target-users endpoints (streaming download, multipart upload, job status). |
| NetCord/Rest/RestClient.Channel.cs | Updates invite creation to send no body when properties are null, otherwise serialize via InviteProperties. |
| NetCord/Rest/JsonModels/JsonInviteTargetUsersJobStatus.cs | Adds JSON DTO for invite target-users job status response. |
| NetCord/Rest/InviteTargetUsersProperties.cs | Adds HTTP-serializable “target users file” builder from stream/enumerable. |
| NetCord/Rest/InviteTargetUsersJobStatus.cs | Adds public wrapper model and status enum for the job status response. |
| NetCord/Rest/InviteProperties.cs | Adds multipart-capable HTTP serialization, target-users file support, and role_ids. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (1)
NetCord/Rest/RestInvite.cs:37
- RestInvite no longer exposes StageInstance and the JSON model no longer deserializes the "stage_instance" field. This is a breaking API change and will silently drop data if the field is still present in Discord responses. If this removal isn’t explicitly intended, reintroduce the StageInstance property + JSON field (it can remain nullable) or mark it obsolete with a migration path.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 18 changed files in this pull request and generated 8 comments.
Comments suppressed due to low confidence (2)
NetCord/Rest/RestInvite.cs:37
StageInstancesupport was removed fromRestInvite/JsonRestInvite. This is a breaking public API change for consumers and also drops data previously surfaced by the model. If removal is intentional, consider keeping the property with[Obsolete]for a deprecation window (or documenting the breaking change).
NetCord/Rest/RestClient.Invite.cs:16- Renaming
GetGuildInviteAsynctoGetInviteAsyncis a breaking change to the public client API. Consider keeping the old method name as an[Obsolete]wrapper forwarding to the new name to preserve backward compatibility.
[GenerateAlias([typeof(RestInvite)], nameof(RestInvite.Code), TypeNameOverride = nameof(Invite))]
public async Task<RestInvite> GetInviteAsync(string inviteCode, bool withCounts = false, bool withExpiration = false, ulong? guildScheduledEventId = null, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
{
if (guildScheduledEventId.HasValue)
return new(await (await SendRequestAsync(HttpMethod.Get, $"/invites/{inviteCode}", $"?with_counts={withCounts}&with_expiration={withExpiration}&guild_scheduled_event_id={guildScheduledEventId}", null, properties, cancellationToken: cancellationToken).ConfigureAwait(false)).ToObjectAsync(Serialization.Default.JsonRestInvite).ConfigureAwait(false), this);
else
return new(await (await SendRequestAsync(HttpMethod.Get, $"/invites/{inviteCode}", $"?with_counts={withCounts}&with_expiration={withExpiration}", null, properties, cancellationToken: cancellationToken).ConfigureAwait(false)).ToObjectAsync(Serialization.Default.JsonRestInvite).ConfigureAwait(false), this);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.