Release 0.0.5

Add chat id logging
This commit is contained in:
kraftwerk28 2020-05-18 10:55:00 +03:00
parent 7b8a7d9859
commit f293d8ae62
9 changed files with 19 additions and 7 deletions

1
.gitignore vendored
View File

@ -24,3 +24,4 @@ hs_err_pid*
build/
.gradle/
local.properties

Binary file not shown.

6
.idea/compiler.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="1.8" />
</component>
</project>

View File

@ -4,16 +4,17 @@
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="delegatedBuild" value="true" />
<option name="testRunner" value="GRADLE" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleHome" value="/usr/share/java/gradle" />
<option name="gradleJvm" value="11" />
<option name="gradleJvm" value="13" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
<option name="useAutoImport" value="true" />
<option name="useQualifiedModuleNames" value="true" />
</GradleProjectSettings>
</option>

View File

@ -6,10 +6,13 @@
</list>
</component>
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$" />
</component>
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_13" project-jdk-name="13" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_13" default="false" project-jdk-name="13" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View File

@ -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

View File

@ -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

View File

@ -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("<b>${event.player.displayName}</b> $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("<b>${event.player.displayName}</b> $leftStr.")
}
}
}

View File

@ -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.