Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/slash-commands/events.command.ts
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Recommend covering this behavior change with a test.

Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class GamblerCommand {

switch (subcommand) {
case "reset":
await this.resetGamblers(role);
await this.resetGamblers(guild, role);

return;
case "award":
Expand All @@ -126,7 +126,10 @@ class GamblerCommand {
}
}

async resetGamblers(role: Role) {
async resetGamblers(guild: Guild, role: Role) {
// role.members filters from the guild members cache, so we fetch here
// to ensure the cache is up to date
await guild.members.fetch();
const members = role.members.values().toArray();
const removed = [];
for (const member of members) {
Expand Down