Skip to content

Commit

Permalink
some tests to check
Browse files Browse the repository at this point in the history
  • Loading branch information
imnaiyar committed Jul 16, 2024
1 parent 2fa7037 commit fb4f071
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions ex.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ WORKDIR /root/skyhelper
COPY ["package.json", "package-lock.json*"]

# SECRETS
ENV NODE_ENV=
ENV TOKEN=
ENV MONGO_CONNECTION=
ENV TOPGG_TOKEN=
Expand Down
16 changes: 16 additions & 0 deletions src/commands/slash/test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { SlashCommand } from "#src/structures/SlashCommands";

export default {
data: {
name: "test",
description: "test stuff",
},
ownerOnly: true,
skipDeploy: true,

async execute(interaction, _t, _client) {
await interaction.deferReply();
// Intentional error to check sentry logging
await interaction.reply("Tested!");
},
} satisfies SlashCommand;
1 change: 1 addition & 0 deletions src/structures/SkyHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ export class SkyHelper extends Client<true> {
public async registerCommands(): Promise<void> {
const toRegister: SlashCommand["data"] | ContextMenuCommand<"MessageContext" | "UserContext">["data"][] = [];
this.commands
.filter((cmd) => !cmd.skipDeploy)
.map((cmd) => ({
name: cmd.data.name,
description: cmd.data.description,
Expand Down
3 changes: 3 additions & 0 deletions src/structures/SlashCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ export interface SlashCommand<Autocomplete extends boolean = false> {
/* Whether or not the command is owner only */
ownerOnly?: boolean;

/* Whether the command should be skipped deploying */
skipDeploy?: boolean;

/* Command cooldown */
cooldown?: number;

Expand Down

0 comments on commit fb4f071

Please sign in to comment.