Archived
1
This repository has been archived on 2022-11-04. You can view files and clone it, but cannot push or open issues or pull requests.
fwzookeeper/domains/battles/v1/forward.go

26 lines
744 B
Go
Raw Normal View History

// Fantasy World Zookeeper Bot
// Copyright (c) 2018 Vladimir "fat0troll" Hodakov
package battlesv1
import (
"gitlab.com/toby3d/telegram"
2018-12-22 17:36:39 +04:00
itelegram "lab.wtfteam.pro/fat0troll/fw_zookeeper/local/telegram"
"strings"
)
// ForwardCommand responds to fight request
func ForwardCommand(update *telegram.Update) {
log.Info().Msg("Battle request received!")
if update.Message.Chat.ID == c.Config.Announces.ChannelID {
log.Info().Msg("This battle is already posted")
}
message := update.Message.Text
if !strings.Contains(message, "join") {
message = strings.Replace(message, "fight", "join_fight", 1)
}
message = strings.Replace(message, "@FWorldBot ", "", 1)
itelegram.RespondWithoutMarkdown(c.Config.Announces.ChannelID, message)
}