|
|
@@ -1589,18 +1589,6 @@ namespace Discord.API |
|
|
|
var ids = new BucketIds(guildId: guildId); |
|
|
|
return await SendAsync<GetGuildPruneCountResponse>("GET", () => $"guilds/{guildId}/prune?days={args.Days}{endpointRoleIds}", ids, options: options).ConfigureAwait(false); |
|
|
|
} |
|
|
|
public async Task<WelcomeScreen> GetGuildWelcomeScreenAsync(ulong guildId, RequestOptions options = null) |
|
|
|
{ |
|
|
|
Preconditions.NotEqual(guildId, 0, nameof(guildId)); |
|
|
|
options = RequestOptions.CreateOrClone(options); |
|
|
|
|
|
|
|
try |
|
|
|
{ |
|
|
|
var ids = new BucketIds(guildId: guildId); |
|
|
|
return await SendAsync<WelcomeScreen>("GET", () => $"guilds/{guildId}/welcome-screen", ids, options: options).ConfigureAwait(false); |
|
|
|
} |
|
|
|
catch (HttpException ex) when (ex.HttpCode == HttpStatusCode.NotFound) { return null; } |
|
|
|
} |
|
|
|
#endregion |
|
|
|
|
|
|
|
#region Guild Bans |
|
|
@@ -2109,6 +2097,35 @@ namespace Discord.API |
|
|
|
|
|
|
|
#endregion |
|
|
|
|
|
|
|
#region Guild Welcome Screen |
|
|
|
|
|
|
|
public async Task<WelcomeScreen> GetGuildWelcomeScreenAsync(ulong guildId, RequestOptions options = null) |
|
|
|
{ |
|
|
|
Preconditions.NotEqual(guildId, 0, nameof(guildId)); |
|
|
|
options = RequestOptions.CreateOrClone(options); |
|
|
|
|
|
|
|
try |
|
|
|
{ |
|
|
|
var ids = new BucketIds(guildId: guildId); |
|
|
|
return await SendAsync<WelcomeScreen>("GET", () => $"guilds/{guildId}/welcome-screen", ids, options: options).ConfigureAwait(false); |
|
|
|
} |
|
|
|
catch (HttpException ex) when (ex.HttpCode == HttpStatusCode.NotFound) { return null; } |
|
|
|
} |
|
|
|
|
|
|
|
public async Task<WelcomeScreen> ModifyGuildWelcomeScreenAsync(ModifyGuildWelcomeScreenParams args, ulong guildId, RequestOptions options = null) |
|
|
|
{ |
|
|
|
Preconditions.NotEqual(guildId, 0, nameof(guildId)); |
|
|
|
Preconditions.NotNull(args, nameof(args)); |
|
|
|
|
|
|
|
options = RequestOptions.CreateOrClone(options); |
|
|
|
|
|
|
|
var ids = new BucketIds(guildId: guildId); |
|
|
|
|
|
|
|
return await SendJsonAsync<WelcomeScreen>("PATCH", () => $"guilds/{guildId}/welcome-screen", args, ids, options: options).ConfigureAwait(false); |
|
|
|
} |
|
|
|
|
|
|
|
#endregion |
|
|
|
|
|
|
|
#region Users |
|
|
|
public async Task<User> GetUserAsync(ulong userId, RequestOptions options = null) |
|
|
|
{ |
|
|
|