diff --git a/GetMeBot/README.md b/GetMeBot/README.md new file mode 100644 index 0000000..74b953e --- /dev/null +++ b/GetMeBot/README.md @@ -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" +``` diff --git a/GetMeBot/build.gradle b/GetMeBot/build.gradle new file mode 100644 index 0000000..034ded0 --- /dev/null +++ b/GetMeBot/build.gradle @@ -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" +} diff --git a/GetMeBot/src/main/kotlin/GetMeBot.kt b/GetMeBot/src/main/kotlin/GetMeBot.kt new file mode 100644 index 0000000..2e9f75b --- /dev/null +++ b/GetMeBot/src/main/kotlin/GetMeBot.kt @@ -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()) +} \ No newline at end of file diff --git a/HelloBot/README.md b/HelloBot/README.md index 3644a6d..660efad 100644 --- a/HelloBot/README.md +++ b/HelloBot/README.md @@ -1,4 +1,4 @@ -# ForwarderBot +# HelloBot The main purpose of this bot is just to answer "Oh, hi, " and add user mention here diff --git a/HelloBot/src/main/kotlin/HelloBot.kt b/HelloBot/src/main/kotlin/HelloBot.kt index d036ff3..968ee1c 100644 --- a/HelloBot/src/main/kotlin/HelloBot.kt +++ b/HelloBot/src/main/kotlin/HelloBot.kt @@ -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() diff --git a/settings.gradle b/settings.gradle index ec7e4a5..e5faa13 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,4 @@ include ":ForwarderBot" include ":RandomFileSenderBot" include ":HelloBot" +include ":GetMeBot"