feat: ignore bot msg
This commit is contained in:
@@ -97,3 +97,10 @@ func CronKick() {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func isBotMsg(msg chat.Message) bool {
|
||||
if msg.Translate == "commands.message.display.outgoing" {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
@@ -97,7 +97,7 @@ func onPlayerMsg(msg chat.Message, validated bool) error {
|
||||
}
|
||||
log.Printf("Player: %s", msg)
|
||||
s := strings.Split(msg.String(), " ")
|
||||
if len(s) > 1 {
|
||||
if len(s) > 1 && !isBotMsg(msg) {
|
||||
if s[0] != fmt.Sprintf("<%v>", conf.GetBotSettings().MCBotName) {
|
||||
m := tgbotapi.NewMessage(conf.GetBotSettings().GroupID, fmt.Sprintf("%v", msg))
|
||||
_, err := conf.Bot.Send(m)
|
||||
|
Reference in New Issue
Block a user