@saykit/carbon
v0.11.0
Published
Carbon Discord framework integration for saykit
Maintainers
Readme
@saykit/carbon
Registers a shared catalogue with your Carbon client, helps command and component classes expose translated metadata, and adds locale-aware interaction.say and guild.say properties.
Install
pnpm add @saykit/carbon saykit @buape/carbonUsage
import { Client, Command, type CommandInteraction } from '@buape/carbon';
import { SayPlugin } from '@saykit/carbon';
import { catalogue, withSay } from './i18n.js';
class PingCommand extends withSay(Command) {
constructor() {
super((say) => ({
name: say`ping`,
description: say`Ping the bot!`,
}));
}
async run(interaction: CommandInteraction) {
await interaction.reply({ content: interaction.say`Pong!` });
}
}
const client = new Client({/* options */}, { commands: [new PingCommand()] }, [
new SayPlugin(catalogue),
]);