elbekD / kt-telegram-bot

Telegram Bot Library for Kotlin language
MIT License
103 stars 19 forks source link

reply for commands doesn't stop #15

Closed vitaB closed 4 years ago

vitaB commented 4 years ago

Hi, I used your example for a webhook and deployed it on heroku, but after starting a chat and using the command /start, the bot keeps sending me the "Hello World! message. The same problem occurs with the /echo command.

Do you have an idea what could be the reason for this?

Except for the configuration and maven for building I used exactly your example: https://github.com/vitaB/testKotlinTelegramBot/blob/master/src/main/kotlin/com/ditcalendar/bot/Bot.kt

elbekD commented 4 years ago

Hi! I will be able to investigate this problem only in 2 weeks. If you have some ideas, you're welcome

elbekD commented 4 years ago

Hi, @vitaB! I've made some commits and maybe found a cause of the problem. Try it in dev branch or use version 1.2.0-beta. The reason may be that the response to the telegram request was not 200 OK and caused some retries. Could not reproduce your case in my environment (used AWS ec2 instance with nginx as proxy)

vitaB commented 4 years ago

Hi @elbekD, thanks, I suppose your are right, it is probably because of the response to the telegram server, since the telegram server retrying to send the request/message to the bot.

Unfortunately I cannot test your solution. The jar from the jitpack is empty. Something about the gradle task is broken, because I have the same problem when I build the jar local from the dev branch. I also tried to build only the library module, but after building it I had a jar without dependencies.

vitaB commented 4 years ago

thanks, i was able to build a fatJar with the shadow plugin now. The fix works and the telegram server also reports that the message was successfully delivered to the bot.

elbekD commented 4 years ago

you just cloned and built library locally?

vitaB commented 4 years ago

jap, build it from the dev branch.