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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 290 - (hide annotations)
Mon Jul 29 17:29:23 2024 UTC (8 months, 1 week ago) by rakin
File MIME type: application/typescript
File size: 1106 byte(s)
feat: add the userlookup slash command
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     }

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26