-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
77 changed files
with
60,257 additions
and
322 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,6 @@ build | |
# Configuration | ||
/tgkotbot/src/main/resources/application.conf | ||
.env | ||
|
||
# Publish | ||
publish.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,43 @@ | ||
# 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 | ||
* [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) | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rootProject.name = "buildSrc" |
71 changes: 71 additions & 0 deletions
71
buildSrc/src/main/kotlin/kotbot-publish-conventions.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import java.util.* | ||
|
||
plugins { | ||
signing | ||
`java-library` | ||
`maven-publish` | ||
} | ||
|
||
group = "io.heapy.kotbot" | ||
|
||
java { | ||
withJavadocJar() | ||
withSourcesJar() | ||
} | ||
|
||
val modules: Map<String, Map<String, String>> = mapOf( | ||
"core" to mapOf( | ||
"publishName" to "Telegram chat bot framework", | ||
"publishDescription" to "Unopinionated and flexible framework for building Telegram chat bots", | ||
), | ||
) | ||
|
||
fun Project.getPublishName(): String = modules.getValue(name).getValue("publishName") | ||
fun Project.getPublishDescription(): String = modules.getValue(name).getValue("publishDescription") | ||
|
||
publishing { | ||
publications { | ||
create<MavenPublication>("maven") { | ||
artifactId = project.name | ||
|
||
from(components["java"]) | ||
|
||
pom { | ||
name = project.getPublishName() | ||
description = project.getPublishDescription() | ||
url = "https://github.com/Heapy/kotbot" | ||
inceptionYear = "2018" | ||
licenses { | ||
license { | ||
name = "GPL-3.0-only" | ||
url = "https://spdx.org/licenses/GPL-3.0-only.html" | ||
} | ||
} | ||
developers { | ||
developer { | ||
id = "ruslan.ibrahimau" | ||
name = "Ruslan Ibrahimau" | ||
email = "[email protected]" | ||
} | ||
} | ||
scm { | ||
connection = "scm:git:https://github.com/Heapy/kotbot.git" | ||
developerConnection = "scm:git:ssh://github.com/Heapy/kotbot.git" | ||
url = "https://github.com/Heapy/kotbot" | ||
} | ||
} | ||
} | ||
} | ||
|
||
repositories { | ||
maven { | ||
url = rootProject.layout.buildDirectory | ||
.dir("staging-deploy") | ||
.get().asFile.toURI() | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
sign(publishing.publications["maven"]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.