elbekD / kt-telegram-bot

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

Bot::onAnyUpdate method not getting any updates. #35

Closed b1sar closed 3 years ago

b1sar commented 3 years ago

The issue is because there is no forwarding in the UpdateHandler:handle function. I solved the issue by adding the following line to handle method just before the starting of the whileclause.

    internal fun handle(update: Update) {
        GlobalScope.launch { onAnyUpdate?.invoke(update) } //added this line and it worked
        when {
            /* content of the when clause not included for brevity */
        } //end of when
    }//end of handle