SaysHQ
SaysHQ
SIASapphire - Imagine a framework
Created by SaysHQ on 10/6/2023 in #sapphire-support
Decorator Style for Register Subcommands
Is there a Short Style possible for that? Like That for normal Slash-Commands
@ApplyOptions<Command.Options>({
description: 'ping pong'
})

registry.registerChatInputCommand({
name: this.name,
description: this.description
});
public override async chatInputRun(interaction: Command.ChatInputCommandInteraction) {
const msg = await interaction.reply({ content: 'Ping?', fetchReply: true });

const content = `Pong! Bot Latency ${Math.round(this.container.client.ws.ping)}ms. API Latency ${
msg.createdTimestamp - interaction.createdTimestamp
}ms.`;

return await interaction.editReply({
content: content
});
}
@ApplyOptions<Command.Options>({
description: 'ping pong'
})

registry.registerChatInputCommand({
name: this.name,
description: this.description
});
public override async chatInputRun(interaction: Command.ChatInputCommandInteraction) {
const msg = await interaction.reply({ content: 'Ping?', fetchReply: true });

const content = `Pong! Bot Latency ${Math.round(this.container.client.ws.ping)}ms. API Latency ${
msg.createdTimestamp - interaction.createdTimestamp
}ms.`;

return await interaction.editReply({
content: content
});
}
18 replies