Skip to content

Commit

Permalink
Fix unused listBans params (#598)
Browse files Browse the repository at this point in the history
* fix `listBans` not using limit/after/before params

* fix sentinels not being set by default in `GuildUpdateBuilder`
  • Loading branch information
MCausc78 authored Dec 7, 2023
1 parent 3ba7e7e commit d04db1a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/src/builders/guild/guild.dart
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ class GuildUpdateBuilder extends UpdateBuilder<Guild> {
this.splash = sentinelImageBuilder,
this.discoverySplash = sentinelImageBuilder,
this.banner = sentinelImageBuilder,
this.systemChannelId,
this.systemChannelId = sentinelSnowflake,
this.systemChannelFlags,
this.rulesChannelId,
this.publicUpdatesChannelId,
this.rulesChannelId = sentinelSnowflake,
this.publicUpdatesChannelId = sentinelSnowflake,
this.preferredLocale,
this.features,
this.description = sentinelString,
this.premiumProgressBarEnabled,
this.safetyAlertsChannelId,
this.safetyAlertsChannelId = sentinelSnowflake,
});

@override
Expand Down
6 changes: 5 additions & 1 deletion lib/src/http/managers/guild_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,11 @@ class GuildManager extends Manager<Guild> {
final route = HttpRoute()
..guilds(id: id.toString())
..bans();
final request = BasicRequest(route);
final request = BasicRequest(route, queryParameters: {
if (limit != null) 'limit': limit.toString(),
if (after != null) 'after': after.toString(),
if (before != null) 'before': before.toString(),
});

final response = await client.httpHandler.executeSafe(request);
final bans = parseMany(response.jsonBody as List, parseBan);
Expand Down

0 comments on commit d04db1a

Please sign in to comment.