import { BotDefinition, Context } from '@guzus/mothership'; /** * {{BOT_NAME_TITLE}} Bot * * This is a template for creating new Telegram bots. * Replace this description with your bot's purpose. */ export const bot: BotDefinition = { // Bot configuration config: { name: '{{BOT_NAME}}', description: '{{BOT_NAME_TITLE}} - A Telegram bot', }, // Bot commands commands: [ { command: 'start', description: 'Start the bot', handler: async (ctx: Context) => { const userName = ctx.from?.first_name || 'there'; await ctx.reply( `Hello ${userName}! 👋\n\n` + `I'm {{BOT_NAME_TITLE}}. Use /help to see what I can do.` ); }, }, { command: 'help', description: 'Show help message', handler: async (ctx: Context) => { await ctx.reply( '📚 *Available Commands*\n\n' + '/start - Start the bot\n' + '/help - Show this help message\n' + '/about - About this bot', { parse_mode: 'Markdown' } ); }, }, { command: 'about', description: 'About this bot', handler: async (ctx: Context) => { await ctx.reply( '🤖 *{{BOT_NAME_TITLE}}*\n\n' + 'Built with @guzus/mothership\n\n' + 'Edit `bots/{{BOT_NAME}}/index.ts` to customize this bot.', { parse_mode: 'Markdown' } ); }, }, ], // Optional: Handle non-command messages messageHandlers: [ { // Example: Respond to "hello" messages pattern: /hello/i, handler: async (ctx: Context) => { await ctx.reply('Hello! 👋 Use /help to see available commands.'); }, }, ], // Optional: Lifecycle hooks onStart: async () => { console.log('🤖 {{BOT_NAME_TITLE}} is starting...'); // Initialize resources, connect to databases, etc. }, onStop: async () => { console.log('🤖 {{BOT_NAME_TITLE}} is stopping...'); // Cleanup resources, close connections, etc. }, };