diff --git a/src/bot/telegram-bot.ts b/src/bot/telegram-bot.ts index df39628..0d168ab 100644 --- a/src/bot/telegram-bot.ts +++ b/src/bot/telegram-bot.ts @@ -56,9 +56,24 @@ export class TelegramBot { this.bot.on('text', async (ctx) => { const chatId = ctx.chat.id; - const userMessage = ctx.message.text; + const userMessage = ctx.message.text.trim(); console.log(`Received message from chat ${chatId}: ${userMessage}`); + const isAptosAddress = /^0x[a-fA-F0-9]{64}$/.test(userMessage); + + if (!isAptosAddress) { + await ctx.reply(`For now, I'm limited to preparing a personalized Telegram report with recommendations. To make this as accurate and helpful as possible, I'll need your Aptos address so I can access the latest information about your portfolio. + +Could you please share your Aptos address? Here's what I'll do once I receive it: + +1. Collect data on your tokens, pools, yields, and liquidity from Liquidswap. +2. Analyze your portfolio. +3. Prepare tailored recommendations and format them into a Telegram post with emojis and detailed explanations. + +Looking forward to helping you! 🚀`); + return; + } + try { const userPipeline: Pipeline = { description: 'Crypto wallet analyzer for Liquidswap',