import {Subcommand} from '@sapphire/plugin-subcommands';
import {Args} from "@sapphire/framework";
import {Message} from "discord.js";
export class AccountCommand extends Subcommand {
public constructor(context: Subcommand.Context, options: Subcommand.Options) {
super(context, {
...options,
name: 'account',
aliases: ['acc', 'link', 'verify'],
description: 'Link to your Discord Account',
subcommands: [
{
name: 'link',
messageRun: 'messageLink',
chatInputRun: 'chatInputLink',
default: true
},
{
name: 'list',
messageRun: 'messageList',
chatInputRun: 'chatInputList'
},
{
name: 'unlink',
messageRun: 'messageUnlink',
chatInputRun: 'chatInputUnlink',
}
]
});
}
registerApplicationCommands(registry: Subcommand.Registry) {
registry.registerChatInputCommand((builder) =>
builder
.setName(this.name)
.setDescription(this.description)
.addSubcommand((command) =>
command
.setName('link')
.setDescription('Link your Discord Account')
.addStringOption((option) =>
option.setName('summoner').setDescription('Summoner Name').setRequired(true)
)
)
.addSubcommand((command) =>
command
.setName('list')
.setDescription('View summoner names linked to your Discord Account')
)
.addSubcommand((command) =>
command
.setName('unlink')
.setDescription('Unlink a summoner name from your Discord Account')
.addStringOption((option) =>
option.setName('summoner').setDescription('Summoner Name').setRequired(true)
)
)
);
}
/** START Link Subcommand **/
public async messageLink(message: Message, args: Args) {
return message.channel.send('Account Link')
}
public async chatInputLink(interaction: Subcommand.ChatInputCommandInteraction) {
return interaction.reply('Account Link Interaction');
}
/** END link Subcommand **/
/** START List Subcommand **/
public async messageList(message: Message, args: Args) {
return message.channel.send('Account List')
}
public async chatInputList(interaction: Subcommand.ChatInputCommandInteraction) {
return interaction.reply('Account List Interaction');
}
/** END List Subcommand **/
/** START Unlink Subcommand **/
public async messageUnlink(message: Message, args: Args) {
return message.channel.send('Account Unlink')
}
public async chatInputUnlink(interaction: Subcommand.ChatInputCommandInteraction) {
return interaction.reply('Account Unlink Interaction');
}
/** END Unlink Subcommand **/
}
import {Subcommand} from '@sapphire/plugin-subcommands';
import {Args} from "@sapphire/framework";
import {Message} from "discord.js";
export class AccountCommand extends Subcommand {
public constructor(context: Subcommand.Context, options: Subcommand.Options) {
super(context, {
...options,
name: 'account',
aliases: ['acc', 'link', 'verify'],
description: 'Link to your Discord Account',
subcommands: [
{
name: 'link',
messageRun: 'messageLink',
chatInputRun: 'chatInputLink',
default: true
},
{
name: 'list',
messageRun: 'messageList',
chatInputRun: 'chatInputList'
},
{
name: 'unlink',
messageRun: 'messageUnlink',
chatInputRun: 'chatInputUnlink',
}
]
});
}
registerApplicationCommands(registry: Subcommand.Registry) {
registry.registerChatInputCommand((builder) =>
builder
.setName(this.name)
.setDescription(this.description)
.addSubcommand((command) =>
command
.setName('link')
.setDescription('Link your Discord Account')
.addStringOption((option) =>
option.setName('summoner').setDescription('Summoner Name').setRequired(true)
)
)
.addSubcommand((command) =>
command
.setName('list')
.setDescription('View summoner names linked to your Discord Account')
)
.addSubcommand((command) =>
command
.setName('unlink')
.setDescription('Unlink a summoner name from your Discord Account')
.addStringOption((option) =>
option.setName('summoner').setDescription('Summoner Name').setRequired(true)
)
)
);
}
/** START Link Subcommand **/
public async messageLink(message: Message, args: Args) {
return message.channel.send('Account Link')
}
public async chatInputLink(interaction: Subcommand.ChatInputCommandInteraction) {
return interaction.reply('Account Link Interaction');
}
/** END link Subcommand **/
/** START List Subcommand **/
public async messageList(message: Message, args: Args) {
return message.channel.send('Account List')
}
public async chatInputList(interaction: Subcommand.ChatInputCommandInteraction) {
return interaction.reply('Account List Interaction');
}
/** END List Subcommand **/
/** START Unlink Subcommand **/
public async messageUnlink(message: Message, args: Args) {
return message.channel.send('Account Unlink')
}
public async chatInputUnlink(interaction: Subcommand.ChatInputCommandInteraction) {
return interaction.reply('Account Unlink Interaction');
}
/** END Unlink Subcommand **/
}