Skip to content

Commit

Permalink
update: 添加Kether支持
Browse files Browse the repository at this point in the history
  • Loading branch information
BingZi-233 committed Oct 24, 2023
1 parent 04438ab commit 1527874
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package online.bingiz.bilibili.video.internal.helper

import org.bukkit.command.CommandSender
import taboolib.library.kether.LocalizedException
import taboolib.module.kether.KetherShell.eval
import taboolib.module.kether.ScriptOptions

fun List<String>.ketherEval(sender: CommandSender) {
try {
eval(this, ScriptOptions.builder().sender(sender).build())
} catch (e: LocalizedException) {
e.message?.let { sender.warningAsLang("KetherLocalizedException", it) }
} catch (e: Throwable) {
e.message?.let { sender.warningAsLang("KetherThrowable", it) }
}
}

fun String.ketherEval(sender: CommandSender) {
try {
eval(this, ScriptOptions.builder().sender(sender).build())
} catch (e: LocalizedException) {
e.message?.let { sender.warningAsLang("KetherLocalizedException", it) }
} catch (e: Throwable) {
e.message?.let { sender.warningAsLang("KetherThrowable", it) }
}
}

0 comments on commit 1527874

Please sign in to comment.