mirror of
https://github.com/xHyroM/bun-discord-bot.git
synced 2024-12-26 14:01:07 +01:00
fix: dont run interaction command when there's no run
This commit is contained in:
parent
2a3bf141d9
commit
75003af03c
3 changed files with 5 additions and 5 deletions
|
@ -1,11 +1,11 @@
|
|||
import { defineCommand } from "../loaders/commands.ts";
|
||||
import { COMMIT_HASH, PRODUCTION } from "../constants.ts";
|
||||
import { CommandContext } from "../structs/context/CommandContext.ts";
|
||||
import { InteractionCommandContext } from "../structs/context/CommandContext.ts";
|
||||
|
||||
export default defineCommand({
|
||||
name: "version",
|
||||
options: [],
|
||||
run: (context: CommandContext) => {
|
||||
run: (context: InteractionCommandContext) => {
|
||||
context.interaction.reply({
|
||||
content: [
|
||||
`[git-bun-discord-bot-${COMMIT_HASH}](<https://github.com/xHyroM/bun-discord-bot/tree/${COMMIT_HASH}>) ${!PRODUCTION ? "(dev)" : ""}`,
|
||||
|
|
|
@ -15,7 +15,7 @@ defineListener({
|
|||
function handleCommand(interaction: ChatInputCommandInteraction) {
|
||||
const command = COMMANDS.get(interaction.commandName);
|
||||
|
||||
if (!command) {
|
||||
if (!command || !command.run) {
|
||||
interaction.reply({
|
||||
content: "Hmm.. Invalid command :P",
|
||||
ephemeral: true,
|
||||
|
|
|
@ -11,10 +11,10 @@ interface StringOption extends SlashCommandStringOption {
|
|||
export interface Command {
|
||||
name: string;
|
||||
options: Option[];
|
||||
run: (
|
||||
run?: (
|
||||
context: CommandContext<true>
|
||||
) => any;
|
||||
runMessage: (
|
||||
runMessage?: (
|
||||
context: CommandContext<false>
|
||||
) => any;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue