@saykit/carbon
v0.1.0
Published
Carbon Discord framework integration for saykit
Maintainers
Readme
@saykit/carbon
Registers a shared Say 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, withSay } from '@saykit/carbon';
import { type Say } from 'saykit';
import say from './i18n.js';
class PingCommand extends withSay(Command) {
constructor(say: Say) {
super(say, (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(say)] },
[new SayPlugin(say)],
);