mirror of
https://github.com/amalthea-mc/spigot-tg-bridge.git
synced 2024-11-09 12:11:06 +00:00
NPE bug fix
This commit is contained in:
parent
a8bf75a977
commit
d819420811
@ -103,9 +103,9 @@ class TgBot(
|
|||||||
update.message?.text?.let {
|
update.message?.text?.let {
|
||||||
commandRegex.matchEntire(it)?.groupValues?.let {
|
commandRegex.matchEntire(it)?.groupValues?.let {
|
||||||
commandMap[it[1]]?.let { it(update) }
|
commandMap[it[1]]?.let { it(update) }
|
||||||
|
} ?: run {
|
||||||
|
onTextHandler(update)
|
||||||
}
|
}
|
||||||
} ?: run {
|
|
||||||
onTextHandler(update)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -185,9 +185,10 @@ class TgBot(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun onTextHandler(update: TgApiService.Update) {
|
private suspend fun onTextHandler(update: TgApiService.Update) {
|
||||||
if (!config.logFromTGtoMC) return
|
|
||||||
val msg = update.message!!
|
val msg = update.message!!
|
||||||
plugin.sendMessageToMinecraft(msg.text!!, msg.from!!.rawUserMention())
|
if (!config.logFromTGtoMC || msg.from == null)
|
||||||
|
return
|
||||||
|
plugin.sendMessageToMinecraft(msg.text!!, msg.from.rawUserMention())
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun formatMsgFromMinecraft(
|
private fun formatMsgFromMinecraft(
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
name: SpigotTGBridge
|
name: SpigotTGBridge
|
||||||
version: "0.16"
|
version: "0.17"
|
||||||
api-version: "1.15"
|
api-version: "1.15"
|
||||||
main: org.kraftwerk28.spigot_tg_bridge.Plugin
|
main: org.kraftwerk28.spigot_tg_bridge.Plugin
|
||||||
description: Telegram <-> Minecraft communication plugin for Spigot.
|
description: Telegram <-> Minecraft communication plugin for Spigot.
|
||||||
|
Loading…
Reference in New Issue
Block a user