mirror of
https://github.com/whekin/household-bot.git
synced 2026-03-31 23:34:04 +00:00
feat(WHE-21): scaffold grammy webhook bot server
This commit is contained in:
26
apps/bot/src/bot.ts
Normal file
26
apps/bot/src/bot.ts
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user