import { Subcommand } from '@sapphire/plugin-subcommands';
import { Command, Args, type ChatInputCommand } from '@sapphire/framework';
import type { Message } from 'discord.js';
export class ClanCommand extends Subcommand {
public constructor(context: Subcommand.Context, options: Subcommand.Options) {
super(context, {
...options,
name: 'clan',
subcommands: [
{
name: 'create',
chatInputRun: 'createClan',
default: true,
},
],
});
}
public override registerApplicationCommands(registry: ChatInputCommand.Registry) {
registry.registerChatInputCommand((builder) =>
builder
.setName('clan')
.setDescription('All clan specific commands')
.addSubcommand((subcommand) => subcommand.setName('create').setDescription('Create a new clan'))
);
}
public async createClan(interaction: Subcommand.ChatInputCommandInteraction) {
console.log('Create Clan command received');
const userID = interaction.options.getUser('user')?.id ?? interaction.user.id;
if (userID !== "488324471657332736") {
await interaction.reply({ content: `https://media.tenor.com/x8v1oNUOmg4AAAAd/rickroll-roll.gif` });
return;
}
console.log('Creating clan'); // MISSING ARGUMENTS HERE ........
}
}
import { Subcommand } from '@sapphire/plugin-subcommands';
import { Command, Args, type ChatInputCommand } from '@sapphire/framework';
import type { Message } from 'discord.js';
export class ClanCommand extends Subcommand {
public constructor(context: Subcommand.Context, options: Subcommand.Options) {
super(context, {
...options,
name: 'clan',
subcommands: [
{
name: 'create',
chatInputRun: 'createClan',
default: true,
},
],
});
}
public override registerApplicationCommands(registry: ChatInputCommand.Registry) {
registry.registerChatInputCommand((builder) =>
builder
.setName('clan')
.setDescription('All clan specific commands')
.addSubcommand((subcommand) => subcommand.setName('create').setDescription('Create a new clan'))
);
}
public async createClan(interaction: Subcommand.ChatInputCommandInteraction) {
console.log('Create Clan command received');
const userID = interaction.options.getUser('user')?.id ?? interaction.user.id;
if (userID !== "488324471657332736") {
await interaction.reply({ content: `https://media.tenor.com/x8v1oNUOmg4AAAAd/rickroll-roll.gif` });
return;
}
console.log('Creating clan'); // MISSING ARGUMENTS HERE ........
}
}