% bun add meinu
import { Meinu, Command } from 'meinu';
let commands = [
new Command<Meinu>({
name: 'ping',
description: 'Pong!',
dmPermission: true, // default: false
ownersOnly: true, // default: false
nsfw: true, // default: false
global: true, // default: false
}).addHandler('chatInput', async (bot, int) => {
const sent = await int.deferReply({
fetchReply: true
});
const diff = sent.createdTimestamp - int.createdTimestamp;
return int.editReply({
content: `🏓 Pong! ${diff}ms`
});
})
];
new Meinu({
name: 'MyBot',
color: 'LuminousVividPink',
})
.register_commands(commands) // registers commands per guild, Command.global for global commands
.init(); // starts the bot, .init(TOKEN) if process.env.TOKEN is not set