Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit 79c512e

Browse files
committed
ngl i forgot what i did lol
1 parent 3a6b3b3 commit 79c512e

File tree

3 files changed

+11
-16
lines changed

3 files changed

+11
-16
lines changed

src/commands/misc/kill.ts

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,23 @@
1-
import { EmbedBuilder, ChatInputCommandInteraction, SlashCommandBuilder } from "discord.js";
1+
import { EmbedBuilder, ChatInputCommandInteraction, SlashCommandBuilder, SlashCommandUserOption } from "discord.js";
22
import { KOGBot } from "../../index.js";
33

44
class KillCommand implements SlashCommand {
55
name = 'kill';
66
description = 'Kill a user (in messages).';
77
subcommands = [];
8-
parameters = [];
8+
parameters = [
9+
new SlashCommandUserOption()
10+
.setName('user')
11+
.setDescription('The user to kill')
12+
.setRequired(true)
13+
];
914
dev = true;
1015
kogBot: KOGBot;
1116

1217
constructor(kogBot: KOGBot) {
1318
this.kogBot = kogBot;
1419
}
1520

16-
getCommandData() {
17-
return new SlashCommandBuilder()
18-
.setName(this.name)
19-
.setDescription(this.description)
20-
.addUserOption(option =>
21-
option.setName('user')
22-
.setDescription('The user to kill')
23-
.setRequired(true)
24-
);
25-
}
26-
2721
async execute(interaction: ChatInputCommandInteraction): Promise<void> {
2822
try {
2923
const user = interaction.options.getUser('user');

src/events/interactionCreate.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ export default class ReadyEvent implements GatewayEvent {
1111
const params = interaction.options;
1212

1313
const commandObj = kogBot.discord_client.commands.list.find(cmd => cmd.instance.name === receivedCommand);
14-
console.log(commandObj);
15-
1614
if (!commandObj) {
1715
interaction.reply("Command not found bro");
1816
return;

src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ class DBot extends Client {
9595

9696
slashCommand.setName(command.name);
9797
slashCommand.setDescription(command.description);
98+
99+
for (const parameter of command.parameters) {
100+
slashCommand.options.push(parameter);
101+
}
98102

99103
if (command.subcommands.length > 0) {
100104
for (const subcommand of command.subcommands) {
@@ -105,7 +109,6 @@ class DBot extends Client {
105109
sub.options.push(parameter);
106110
}
107111
slashCommand.addSubcommand(sub);
108-
109112
}
110113

111114
}

0 commit comments

Comments
 (0)