Skip to content

Add community invites#297

Merged
KubaZ2 merged 17 commits intoalphafrom
feature/community-invites
Apr 5, 2026
Merged

Add community invites#297
KubaZ2 merged 17 commits intoalphafrom
feature/community-invites

Conversation

@KubaZ2
Copy link
Copy Markdown
Member

@KubaZ2 KubaZ2 commented Mar 9, 2026

No description provided.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 9, 2026

The documentation preview is available at https://preview.netcord.dev/297.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 InviteProperties to support multipart payloads (JSON + target users file) and add role_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.

@KubaZ2 KubaZ2 requested a review from Copilot April 3, 2026 15:31
@KubaZ2 KubaZ2 marked this pull request as ready for review April 3, 2026 15:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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

  • StageInstance support was removed from RestInvite/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 GetGuildInviteAsync to GetInviteAsync is 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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@KubaZ2 KubaZ2 merged commit b44fc6d into alpha Apr 5, 2026
5 checks passed
@KubaZ2 KubaZ2 deleted the feature/community-invites branch April 5, 2026 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants