From f293d8ae6281cada49bab28d90788256696a563d Mon Sep 17 00:00:00 2001 From: kraftwerk28 Date: Mon, 18 May 2020 10:55:00 +0300 Subject: [PATCH] Release 0.0.5 Add chat id logging --- .gitignore | 1 + .idea/caches/build_file_checksums.ser | Bin 0 -> 454 bytes .idea/compiler.xml | 6 ++++++ .idea/gradle.xml | 5 +++-- .idea/misc.xml | 5 ++++- gradle/wrapper/gradle-wrapper.properties | 2 +- .../org/kraftwerk28/spigot_tg_bridge/Bot.kt | 1 + .../org/kraftwerk28/spigot_tg_bridge/Plugin.kt | 4 ++-- src/main/resources/plugin.yml | 2 +- 9 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 .idea/caches/build_file_checksums.ser create mode 100644 .idea/compiler.xml diff --git a/.gitignore b/.gitignore index 056843e..f4bb371 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ hs_err_pid* build/ .gradle/ +local.properties diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser new file mode 100644 index 0000000000000000000000000000000000000000..781ac28f6205013dd03320fdfbc3122e8a58bf8b GIT binary patch literal 454 zcmZ4UmVvdnh`~NNKUXg?FQq6yGexf?KR>5fFEb@IQ7^qHF(oHeub?PDD>b=9F91S2 zm1gFoxMk*~I%lLNXBU^|7Q2L-Ts|(GuF1r}uGBYr_F>vMNC#JY1CYR(Fc`|U8WE7u2QWrs`)GC8m{>rxs-!S?EKJ&_{$%L26M+W@>S1AwwMl8_1k1vOPEZ88)%JY~Y;n z=7&>V34=gResW?CC@?V;-<{TS;XpyMYR$>6Ta8~O)|4;^;xT&lCFAr1_B$@jy`*-O JOCfMu1pp&To~i%< literal 0 HcmV?d00001 diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..61a9130 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 607995c..91886a8 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -4,16 +4,17 @@ diff --git a/.idea/misc.xml b/.idea/misc.xml index 17ae061..53525f9 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -6,10 +6,13 @@ + + + - + \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index d51a71c..8490104 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ #Sat Feb 08 20:44:49 EET 2020 -distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStorePath=wrapper/dists diff --git a/src/main/kotlin/org/kraftwerk28/spigot_tg_bridge/Bot.kt b/src/main/kotlin/org/kraftwerk28/spigot_tg_bridge/Bot.kt index 9949bd1..fa9f734 100644 --- a/src/main/kotlin/org/kraftwerk28/spigot_tg_bridge/Bot.kt +++ b/src/main/kotlin/org/kraftwerk28/spigot_tg_bridge/Bot.kt @@ -23,6 +23,7 @@ class Bot(private var plugin: Plugin) : TelegramLongPollingBot() { override fun onUpdateReceived(update: Update?) { val msg = update?.message + plugin.logger.info("chat id: ${msg?.chatId}, message id: ${msg?.messageId}") if (msg == null || msg.text == null) return if (!allowedChats.contains(msg.chatId)) return diff --git a/src/main/kotlin/org/kraftwerk28/spigot_tg_bridge/Plugin.kt b/src/main/kotlin/org/kraftwerk28/spigot_tg_bridge/Plugin.kt index 3ebbc12..259d6bd 100644 --- a/src/main/kotlin/org/kraftwerk28/spigot_tg_bridge/Plugin.kt +++ b/src/main/kotlin/org/kraftwerk28/spigot_tg_bridge/Plugin.kt @@ -68,7 +68,7 @@ class Plugin : JavaPlugin(), Listener { fun onPlayerJoin(event: PlayerJoinEvent) { if (config.getBoolean("logJoinLeave", false)) { val joinStr = config.getString("strings.joined", "joined") - tgBot?.broadcastToTG("${event.player.displayName} $joinStr.") + tgBot?.broadcastToTG("${event.player.displayName} $joinStr.") } } @@ -76,7 +76,7 @@ class Plugin : JavaPlugin(), Listener { fun onPlayerLeave(event: PlayerQuitEvent) { if (config.getBoolean("logJoinLeave", false)) { val leftStr = config.getString("strings.left", "joined") - tgBot?.broadcastToTG("${event.player.displayName} $leftStr.") + tgBot?.broadcastToTG("${event.player.displayName} $leftStr.") } } } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 5d16868..5329f7f 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ name: SpigotTGBridge -version: 0.0.4 +version: 0.0.5 api-version: '1.15' main: org.kraftwerk28.spigot_tg_bridge.Plugin description: Telegram <-> Minecraft communication plugin for Spigot.