mirror of
https://github.com/whekin/household-bot.git
synced 2026-03-31 20:54:03 +00:00
28 lines
715 B
TypeScript
28 lines
715 B
TypeScript
import { Bot } from 'grammy'
|
|
|
|
export function createTelegramBot(token: string): Bot {
|
|
const bot = new Bot(token)
|
|
|
|
bot.command('help', async (ctx) => {
|
|
await ctx.reply(
|
|
[
|
|
'Household bot scaffold is live.',
|
|
'Available commands:',
|
|
'/help - Show command list',
|
|
'/household_status - Show placeholder household status',
|
|
'/anon <message> - Send anonymous household feedback in a private chat'
|
|
].join('\n')
|
|
)
|
|
})
|
|
|
|
bot.command('household_status', async (ctx) => {
|
|
await ctx.reply('Household status is not connected yet. Data integration is next.')
|
|
})
|
|
|
|
bot.catch((error) => {
|
|
console.error('Telegram bot error', error.error)
|
|
})
|
|
|
|
return bot
|
|
}
|