1 |
import { CommandInteraction } from "discord.js"; |
2 |
import Client from "../../client/Client"; |
3 |
import InteractionOptions from "../../types/InteractionOptions"; |
4 |
import BaseCommand from "../../utils/structures/BaseCommand"; |
5 |
|
6 |
export default class LookupCommand extends BaseCommand { |
7 |
supportsInteractions: boolean = true; |
8 |
supportsLegacy: boolean = false; |
9 |
|
10 |
constructor() { |
11 |
super("lookup", "information", []); |
12 |
} |
13 |
|
14 |
async run(client: Client, interaction: CommandInteraction, options: InteractionOptions): Promise<void> { |
15 |
if (interaction.options.getSubcommand() === "user") { |
16 |
await client.commands.get("userlookup")?.execute(client, interaction, options); |
17 |
} |
18 |
else if (interaction.options.getSubcommand() === "guild") { |
19 |
await client.commands.get("guildlookup")?.execute(client, interaction, options); |
20 |
} |
21 |
else if (interaction.options.getSubcommand() === "avatar") { |
22 |
await client.commands.get("avatarlookup")?.execute(client, interaction, options); |
23 |
} |
24 |
else { |
25 |
await interaction.reply({ content: "Invalid subcommand given. Must be one of 'user' or 'guild'." }); |
26 |
} |
27 |
} |
28 |
} |