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