/[sudobot]/trunk/src/commands/information/LookupCommand.ts
ViewVC logotype

Contents of /trunk/src/commands/information/LookupCommand.ts

Parent Directory Parent Directory | Revision Log Revision Log


Revision 297 - (show annotations)
Mon Jul 29 17:29:25 2024 UTC (8 months, 1 week ago) by rakin
File MIME type: application/typescript
File size: 1279 byte(s)
feat: add a PFP lookup command (#64)
1 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 if (interaction.options.getSubcommand() === "avatar") {
23 await client.commands.get("avatarlookup")?.execute(client, interaction, options);
24 }
25 else {
26 await interaction.reply({ content: "Invalid subcommand given. Must be one of 'user' or 'guild'." });
27 }
28 }
29 }

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26