Skip to content

Commit

Permalink
feat: use a more generic message for cooldowns (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
HeadTriXz authored Oct 6, 2024
1 parent e2adfc5 commit 0428c2c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@barry-bot/core",
"version": "1.1.1",
"version": "1.1.2",
"description": "A toolkit for building advanced Discord bots.",
"repository": "HeadTriXz/Barry",
"author": "HeadTriXz",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class ApplicationCommandInteractionHandler implements InteractionHandler
const expiresAt = this.#client.cooldowns.get(key);

if (expiresAt !== undefined) {
throw new ValidationError(`Barry needs to rest his wings for a moment. Bee patient, he'll be back in action <t:${Math.trunc(expiresAt / 1000)}:R>.`);
throw new ValidationError(`Please wait before using the command again. You can use it again <t:${Math.trunc(expiresAt / 1000)}:R>.`);
}

this.#client.cooldowns.set(key, command.cooldown * 1000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ describe("ApplicationCommandInteractionHandler", () => {
await handler.handle(interaction);

await expect(() => handler.handle(interaction)).rejects.toThrowError(
"Barry needs to rest his wings for a moment."
"Please wait before using the command again. You can use it again "
);
});
});
Expand Down

0 comments on commit 0428c2c

Please sign in to comment.