Open Tr0jsperi opened 7 years ago
The bot is not intelligent as human... As i know your questions ..... First check the message text Second use state for your multiple levels , ex. Use arrays ....
@FaRzad-845 Thanks for your reply. For now I use a flag to determine if the user's message has been replied. If the chat process has given the answer once, it will not response to location message any more. But actually the chat process is still running. Will it take too much memory space when more and more chat established? I'm new to node.js and javascript so I'm not familiar with the memory allocation and release mechanism in this case.
+1 , I have another issue same as you. (https://github.com/yagop/node-telegram-bot-api/issues/513)
My Problem Solved with This: (https://github.com/saeedhei/node-telegram-bot-api-message-receiver)
+1 I also have a similar issue
Question
I created a weather forecast bot based on user's location. I use
bot.onText(/\/weather/...
to handle user's request and send a message includingreply_markup
to get user's location. Then I usebot.on('location',...
to make the bot react when the user send the location. Everything goes well when I chat with the bot for the first time. But when I send/weather
second time, the bot ask for my location again. After I sent the location, the first chat process got the location too, so the bot gives duplicated answer. If I ask the bot again, it'll send three same answers... I'd like to know is there any way to stop the chat after the bot has made response so the bot can give just one answer each time?