Skip to content

Commit

Permalink
🪱 Fixed Autocomplete interaction error #17
Browse files Browse the repository at this point in the history
  • Loading branch information
theSaintKappa committed Mar 17, 2024
1 parent 0cf040d commit 6cb3f3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
8 changes: 2 additions & 6 deletions src/commands/slash/moses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,8 @@ export default {
}),
);

switch (subcommand) {
case "list":
return Array.from({ length: Math.ceil((await MosesQuote.countDocuments()) / pageSize) }, (_, i) => ({ name: `Page ${i + 1}`, value: i + 1 }));
case "edit" || "delete":
return await getRecentQuotesAutocomplete();
}
if (subcommand === "list") return Array.from({ length: Math.ceil((await MosesQuote.countDocuments()) / pageSize) }, (_, i) => ({ name: i + 1, value: i + 1 }));
if (subcommand === "edit" || subcommand === "delete") return await getRecentQuotesAutocomplete();
},

scope: CommandScope.Guild,
Expand Down
8 changes: 2 additions & 6 deletions src/commands/slash/pt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,8 @@ export default {
}),
);

switch (subcommand) {
case "list":
return Array.from({ length: Math.ceil((await PtQuote.countDocuments()) / pageSize) }, (_, i) => ({ name: `Page ${i + 1}`, value: i + 1 }));
case "edit" || "delete":
return await getRecentQuotesAutocomplete();
}
if (subcommand === "list") return Array.from({ length: Math.ceil((await PtQuote.countDocuments()) / pageSize) }, (_, i) => ({ name: i + 1, value: i + 1 }));
if (subcommand === "edit" || subcommand === "delete") return await getRecentQuotesAutocomplete();
},

scope: CommandScope.Guild,
Expand Down

0 comments on commit 6cb3f3b

Please sign in to comment.