Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/heapy/kotbot
Bot for Kotlin chats in telegram.
https://github.com/heapy/kotbot
docker hacktoberfest kotlin telegram telegram-bot
Last synced: about 2 months ago
JSON representation
Bot for Kotlin chats in telegram.
- Host: GitHub
- URL: https://github.com/heapy/kotbot
- Owner: Heapy
- License: gpl-3.0
- Created: 2018-06-09T21:48:02.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2024-10-22T09:34:06.000Z (3 months ago)
- Last Synced: 2024-10-24T17:53:05.123Z (3 months ago)
- Topics: docker, hacktoberfest, kotlin, telegram, telegram-bot
- Language: Kotlin
- Homepage: https://t.me/tgkotbot
- Size: 3.68 MB
- Stars: 21
- Watchers: 5
- Forks: 3
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# kotbot [![Build](https://github.com/Heapy/kotbot/actions/workflows/build.yml/badge.svg)](https://github.com/Heapy/kotbot/actions/workflows/build.yml)
* [Core](https://github.com/Heapy/kotbot/tree/main/core#readme) – Lightweight, opinionated library
implementing [telegram bot api](https://core.telegram.org/bots)
* [Tgkotbot](https://github.com/Heapy/kotbot/tree/main/tgkotbot#readme) – Bot implementation for needs
of [Kotlin Community](https://t.me/kotlin_forum) in the telegram## Bot API 7.9
### Install library
```kotlin
implementation("io.heapy.kotbot:core:1.0.0")
```### Example
Execute a single method:
```kotlin
suspend fun main() {
val kotbot = Kotbot(
token = System.getenv("KOTBOT_TOKEN"),
)kotbot.execute(GetMe())
.also(::println)
}
```Subscribe for updates:
```kotlin
suspend fun main() {
val kotbot = Kotbot(
token = System.getenv("KOTBOT_TOKEN"),
)// Flow, which emits updates
kotbot.receiveUpdates()
.onEach(::println)
}
```