mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI-examples.git
synced 2024-11-18 22:33:53 +00:00
add GetMe bot and fix some other bots
This commit is contained in:
parent
0517f451f1
commit
d853b6a284
9
GetMeBot/README.md
Normal file
9
GetMeBot/README.md
Normal file
@ -0,0 +1,9 @@
|
||||
# GetMeBot
|
||||
|
||||
This is one of the most easiest bot - it will just print information about itself
|
||||
|
||||
## Launch
|
||||
|
||||
```bash
|
||||
../gradlew run --args="BOT_TOKEN"
|
||||
```
|
24
GetMeBot/build.gradle
Normal file
24
GetMeBot/build.gradle
Normal file
@ -0,0 +1,24 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'kotlin'
|
||||
apply plugin: 'application'
|
||||
|
||||
mainClassName="HelloBotKt"
|
||||
|
||||
repositories {
|
||||
jcenter()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
||||
|
||||
implementation "com.github.insanusmokrassar:TelegramBotAPI-all:$telegram_bot_api_version"
|
||||
}
|
13
GetMeBot/src/main/kotlin/GetMeBot.kt
Normal file
13
GetMeBot/src/main/kotlin/GetMeBot.kt
Normal file
@ -0,0 +1,13 @@
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.extensions.api.bot.getMe
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.extensions.api.telegramBot
|
||||
|
||||
/**
|
||||
* This is one of the most easiest bot - it will just print information about itself
|
||||
*/
|
||||
suspend fun main(vararg args: String) {
|
||||
val botToken = args.first()
|
||||
|
||||
val bot = telegramBot(botToken)
|
||||
|
||||
println(bot.getMe())
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
# ForwarderBot
|
||||
# HelloBot
|
||||
|
||||
The main purpose of this bot is just to answer "Oh, hi, " and add user mention here
|
||||
|
||||
|
@ -13,6 +13,9 @@ import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.flow.launchIn
|
||||
import kotlinx.coroutines.flow.onEach
|
||||
|
||||
/**
|
||||
* The main purpose of this bot is just to answer "Oh, hi, " and add user mention here
|
||||
*/
|
||||
suspend fun main(vararg args: String) {
|
||||
val botToken = args.first()
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
include ":ForwarderBot"
|
||||
include ":RandomFileSenderBot"
|
||||
include ":HelloBot"
|
||||
include ":GetMeBot"
|
||||
|
Loading…
Reference in New Issue
Block a user