mirror of
https://github.com/amalthea-mc/spigot-tg-bridge.git
synced 2024-11-23 10:52:26 +00:00
Release 0.0.5
Add chat id logging
This commit is contained in:
parent
7b8a7d9859
commit
f293d8ae62
1
.gitignore
vendored
1
.gitignore
vendored
@ -24,3 +24,4 @@ hs_err_pid*
|
||||
|
||||
build/
|
||||
.gradle/
|
||||
local.properties
|
||||
|
BIN
.idea/caches/build_file_checksums.ser
Normal file
BIN
.idea/caches/build_file_checksums.ser
Normal file
Binary file not shown.
6
.idea/compiler.xml
Normal file
6
.idea/compiler.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="1.8" />
|
||||
</component>
|
||||
</project>
|
@ -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>
|
||||
|
@ -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>
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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.")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user