rapierorg / telegram-bot-swift

Telegram Bot SDK for Swift (unofficial)
https://github.com/rapierorg/telegram-bot-swift/wiki
Apache License 2.0
375 stars 63 forks source link

Bot not working on Ubuntu 16.04 with Swift 5.2.4 #113

Closed iComputerfreak closed 2 years ago

iComputerfreak commented 4 years ago

When running my bot (which uses your API v2.1.0) on Ubuntu 16.04, the API's getUpdates request does not work. When starting the bot I get the following output:

user@hostname:~/NotifierBot$ ./Notifier
Installation Directory: /home/user/NotifierBot
endpoint: getMe, data: 
endpoint: getUpdates, data: 
endpoint: getUpdates, data: 
endpoint: getUpdates, data: 
endpoint: getUpdates, data: 
endpoint: getUpdates, data: 
endpoint: getUpdates, data: 

When I run the same bot on macOS 10.15 (Catalina), it works like expected:

Installation Directory: [...]
endpoint: getMe, data: 
endpoint: getUpdates, data: timeout=60&limit=100

After every getUpdates request, the bot waits 60 seconds or until someone uses a command. On Ubuntu, the bot just spams the getUpdates requests (2 at a time, every two second).

If I use a command, while the bot runs on Ubuntu, the bot tries to send the reply infinitely (but no message is received by me in Telegram).

endpoint: sendMessage, data: disable_notification=true&text=THE_MESSAGE&disable_web_page_preview=true
endpoint: getUpdates, data: 

This happens more than once per second.

Both machines use Swift 5.2.4 My Bot: https://github.com/iComputerfreak/NotifierBot

iComputerfreak commented 3 years ago

I can confirm, that the bug also exists when creating a new project using the Trivial Bot example from the README.md.

nerzh commented 3 years ago

it seems they don't support it, maybe you try my package for Vapor https://github.com/nerzh/telegram-vapor-bot

iComputerfreak commented 3 years ago

Thanks, but I already switched to another SDK now.