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 won't start. #105

Closed hdcola closed 4 years ago

hdcola commented 4 years ago

program out:

ndpoint: getMe, data: endpoint: getUpdates, data: limit=100&timeout=60 Fatal error: Server stopped due to error: Optional(Codable failed to decode result): zsh: illegal hardware instruction .build/debug/cityhelper

I see an update.prettyPrint() in the sample code, but this option is not supported in version 2.0.0 of the library :(

cipi1965 commented 4 years ago

Are you running directly? What if you run swift build?

hdcola commented 4 years ago

https://github.com/HDCodePractice/CityHelper/tree/master/cityhelper This is the project I ran. It works with either xcode or swift build. I have two BOTs, one of which has this problem when the BOT is running and the other one has no problem.

hdcola commented 4 years ago

I did the LIMIT setup. bot.defaultUpdatesLimit = 1 Then one by one, looking at what's stuck in the end, I find that the message that's out of order is VIDEO, and it seems that there's a problem parsing the VIDEO json?

"video":{"duration":11,"width":1054,"height":1534,"mime_type":"video/mp4","thumb":{"file_id":"xxx","file_unique_id":"xxx","file_size":14976,"width":220,"height":320},"file_id":"xxx","file_unique_id":"xxx","file_size":8627235}}}

cipi1965 commented 4 years ago

Try using my PR (#106) branch https://github.com/cipi1965/telegram-bot-swift/tree/fix-video-definition

hdcola commented 4 years ago

Try using my PR (#106) branch https://github.com/cipi1965/telegram-bot-swift/tree/fix-video-definition

yes,this bug is fixed