mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-09-02 22:59:48 +00:00
fixes, new readme
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
# TelegramBotAPI extensions
|
||||
|
||||
[](https://github.com/KotlinBy/awesome-kotlin)
|
||||
[ ](https://bintray.com/insanusmokrassar/StandardRepository/TelegramBotAPI-extensions-api/_latestVersion)
|
||||
[](https://maven-badges.herokuapp.com/maven-central/com.github.insanusmokrassar/TelegramBotAPI-extensions-api)
|
||||
[](https://jenkins.insanusmokrassar.com/job/TelegramBotAPI-extensions-api_master__publishing/)
|
||||
|
||||
## What is it?
|
||||
|
||||
@@ -99,3 +97,21 @@ filter.messageFlow.mapNotNull {
|
||||
CoroutineScope(Dispatchers.Default)
|
||||
)
|
||||
```
|
||||
|
||||
### Alternative way
|
||||
|
||||
There is an alternative way to get updates. In fact it is almost the same, but could be more useful for some cases:
|
||||
|
||||
```kotlin
|
||||
val filter = bot.startGettingOfUpdates(
|
||||
scope = CoroutineScope(Dispatchers.Default)
|
||||
) { // Here as reveiver will be FlowsUpdatesFilter
|
||||
messageFlow.mapNotNull {
|
||||
it.data as? ContentMessage<*>
|
||||
}.onEach {
|
||||
println(it)
|
||||
}.launchIn(
|
||||
CoroutineScope(Dispatchers.Default)
|
||||
)
|
||||
}
|
||||
```
|
||||
|
Reference in New Issue
Block a user