Skip to content

Commit 4d7907f

Browse files
committed
fix!: Change method signature of GetInviteByCodeAsync
1 parent 94b39ee commit 4d7907f

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

DisCatSharp/Clients/DiscordClient.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,29 +1108,27 @@ public bool TryGetGuildWidget(ulong id, [NotNullWhen(true)] out DiscordWidget? w
11081108
/// </summary>
11091109
/// <param name="code">The invite code.</param>
11101110
/// <param name="withCounts">Whether to include presence and total member counts in the returned invite.</param>
1111-
/// <param name="withExpiration">Whether to include the expiration date in the returned invite.</param>
11121111
/// <param name="scheduledEventId">The scheduled event id.</param>
11131112
/// <returns>The requested invite.</returns>
1114-
/// <exception cref="NotFoundException">Thrown when the invite does not exists.</exception>
1113+
/// <exception cref="NotFoundException">Thrown when the invite does not exist.</exception>
11151114
/// <exception cref="BadRequestException">Thrown when an invalid parameter was provided.</exception>
11161115
/// <exception cref="ServerErrorException">Thrown when Discord is unable to process the request.</exception>
1117-
public Task<DiscordInvite> GetInviteByCodeAsync(string code, bool? withCounts = null, bool? withExpiration = null, ulong? scheduledEventId = null)
1118-
=> this.ApiClient.GetInviteAsync(code, withCounts, withExpiration, scheduledEventId);
1116+
public Task<DiscordInvite> GetInviteByCodeAsync(string code, bool? withCounts = null, ulong? scheduledEventId = null)
1117+
=> this.ApiClient.GetInviteAsync(code, withCounts, scheduledEventId);
11191118

11201119
/// <summary>
11211120
/// Tries to get an invite.
11221121
/// </summary>
11231122
/// <param name="code">The invite code.</param>
11241123
/// <param name="invite">The invite, if found.</param>
11251124
/// <param name="withCounts">Whether to include presence and total member counts in the returned invite.</param>
1126-
/// <param name="withExpiration">Whether to include the expiration date in the returned invite.</param>
11271125
/// <param name="scheduledEventId">The scheduled event id.</param>
11281126
/// <returns>True if the invite was found, otherwise false.</returns>
1129-
public bool TryGetInviteByCode(string code, [NotNullWhen(true)] out DiscordInvite? invite, bool? withCounts = null, bool? withExpiration = null, ulong? scheduledEventId = null)
1127+
public bool TryGetInviteByCode(string code, [NotNullWhen(true)] out DiscordInvite? invite, bool? withCounts = null, ulong? scheduledEventId = null)
11301128
{
11311129
try
11321130
{
1133-
invite = this.GetInviteByCodeAsync(code, withCounts, withExpiration, scheduledEventId).ConfigureAwait(false).GetAwaiter().GetResult();
1131+
invite = this.GetInviteByCodeAsync(code, withCounts, scheduledEventId).ConfigureAwait(false).GetAwaiter().GetResult();
11341132
return true;
11351133
}
11361134
catch (NotFoundException)

DisCatSharp/Net/Rest/DiscordApiClient.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4935,13 +4935,11 @@ internal async Task<IReadOnlyList<DiscordInvite>> GetGuildInvitesAsync(ulong gui
49354935
/// <param name="withCounts">If true, with_counts.</param>
49364936
/// <param name="withExpiration">If true, with_expiration.</param>
49374937
/// <param name="guildScheduledEventId">The scheduled event id to get.</param>
4938-
internal async Task<DiscordInvite> GetInviteAsync(string inviteCode, bool? withCounts, bool? withExpiration, ulong? guildScheduledEventId)
4938+
internal async Task<DiscordInvite> GetInviteAsync(string inviteCode, bool? withCounts, ulong? guildScheduledEventId)
49394939
{
49404940
var urlParams = new Dictionary<string, string>();
49414941
if (withCounts.HasValue)
49424942
urlParams["with_counts"] = withCounts?.ToString();
4943-
if (withExpiration.HasValue)
4944-
urlParams["with_expiration"] = withExpiration?.ToString();
49454943
if (guildScheduledEventId.HasValue)
49464944
urlParams["guild_scheduled_event_id"] = guildScheduledEventId?.ToString();
49474945

0 commit comments

Comments
 (0)