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 Sending Out Messages #99

Closed tanwei0319 closed 4 years ago

tanwei0319 commented 4 years ago

I can see in the logs that sendMessage is called but my Telegram bot did not actually send out the message. This is a snippet of my code:

while let update = bot.nextUpdateSync() {
    if let message = update.message, let text = message.text, let from = message.from {
        let id = ChatId.chat(message.chat.id)
        bot.sendMessageSync(chatId: id, text: "say what \(text)")
        bot.sendMessageAsync(chatId: id, text: "CAN SEND PLEASE")
    }
}

I've tried manually hitting the send message API on web with my bot token and chat id and it worked, the bot did send the text TestReply:

https://api.telegram.org/bot<MY_BOT_TOKEN>/sendMessage?chat_id=<CHAT_ID>&text=TestReply
cipi1965 commented 4 years ago

It works for me, can you see if there's any message in the log?

zmeyc commented 4 years ago

@tanwei0319 I also checked that it's working, please reopen if you still observe this problem.