feat(WHE-21): scaffold grammy webhook bot server

This commit is contained in:
2026-03-05 04:17:04 +04:00
parent eef54ac183
commit f8c3e4ccf5
9 changed files with 286 additions and 3 deletions

26
apps/bot/src/bot.ts Normal file
View File

@@ -0,0 +1,26 @@
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'
].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
}