mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI-examples.git
synced 2025-09-03 15:19:49 +00:00
add GetMe bot and fix some other bots
This commit is contained in:
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())
|
||||
}
|
Reference in New Issue
Block a user