Skip to content

Commit

Permalink
add on message example telegram bot starter
Browse files Browse the repository at this point in the history
  • Loading branch information
leovigna committed Nov 24, 2024
1 parent e39dd78 commit 5323743
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/starter-telegram-bot/src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@ export const bot = getBot<MySessionState, MyContext>({
initial: () => ({ counter: 0 }),
}),
});

// Catch all when outside of command context
bot.on("message", async (ctx) => {
const message = ctx.message; // the message object
await ctx.reply(`Echo: ${message.text}`);
});

0 comments on commit 5323743

Please sign in to comment.