This repository has been archived on 2022-11-04. You can view files and clone it, but cannot push or open issues/pull-requests.
2018-11-29 22:15:21 +04:00
|
|
|
// 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"
|
2018-11-29 22:15:21 +04:00
|
|
|
"strings"
|
|
|
|
)
|
|
|
|
|
|
|
|
// ForwardCommand responds to fight request
|
|
|
|
func ForwardCommand(update *telegram.Update) {
|
|
|
|
log.Info().Msg("Battle request received!")
|
2018-11-29 23:24:13 +04:00
|
|
|
if update.Message.Chat.ID == c.Config.Announces.ChannelID {
|
|
|
|
log.Info().Msg("This battle is already posted")
|
|
|
|
}
|
2018-11-29 22:15:21 +04:00
|
|
|
message := update.Message.Text
|
2018-11-29 23:24:13 +04:00
|
|
|
if !strings.Contains(message, "join") {
|
|
|
|
message = strings.Replace(message, "fight", "join_fight", 1)
|
|
|
|
}
|
2018-11-29 22:15:21 +04:00
|
|
|
message = strings.Replace(message, "@FWorldBot ", "", 1)
|
|
|
|
|
|
|
|
itelegram.RespondWithoutMarkdown(c.Config.Announces.ChannelID, message)
|
|
|
|
}
|