add GetMe bot and fix some other bots

This commit is contained in:
InsanusMokrassar 2020-06-02 21:48:07 +06:00
parent 0517f451f1
commit d853b6a284
6 changed files with 51 additions and 1 deletions

9
GetMeBot/README.md Normal file
View 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
View 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"
}

View 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())
}

View File

@ -1,4 +1,4 @@
# ForwarderBot # HelloBot
The main purpose of this bot is just to answer "Oh, hi, " and add user mention here The main purpose of this bot is just to answer "Oh, hi, " and add user mention here

View File

@ -13,6 +13,9 @@ import kotlinx.coroutines.*
import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach 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) { suspend fun main(vararg args: String) {
val botToken = args.first() val botToken = args.first()

View File

@ -1,3 +1,4 @@
include ":ForwarderBot" include ":ForwarderBot"
include ":RandomFileSenderBot" include ":RandomFileSenderBot"
include ":HelloBot" include ":HelloBot"
include ":GetMeBot"