Add `/games_chat
` command
This command will send user link to our games-enabled chat.
This commit is contained in:
parent
f67e652ae4
commit
24e619a446
@ -1,5 +1,5 @@
|
||||
// i2_bot – Instinct PokememBro Bot
|
||||
// Copyright (c) 2017 Vladimir "fat0troll" Hodakov
|
||||
// Copyright (c) 2017-2018 Vladimir "fat0troll" Hodakov
|
||||
|
||||
package router
|
||||
|
||||
@ -64,6 +64,9 @@ func (r *Router) routePrivateRequest(update tgbotapi.Update, playerRaw *dbmappin
|
||||
case update.Message.Command() == "bastion":
|
||||
c.Talkers.BastionMessage(&update, playerRaw)
|
||||
return "ok"
|
||||
case update.Message.Command() == "games_chat":
|
||||
c.Talkers.GamesMessage(&update, playerRaw)
|
||||
return "ok"
|
||||
|
||||
case pokedexMsg.MatchString(text):
|
||||
c.Pokedexer.PokememesList(&update)
|
||||
|
@ -48,6 +48,24 @@ func (t *Talkers) BastionMessage(update *tgbotapi.Update, playerRaw *dbmapping.P
|
||||
return constants.UserRequestSuccess
|
||||
}
|
||||
|
||||
// GamesMessage gives user link to Bastion
|
||||
func (t *Talkers) GamesMessage(update *tgbotapi.Update, playerRaw *dbmapping.Player) string {
|
||||
message := ""
|
||||
|
||||
if playerRaw.LeagueID > 1 {
|
||||
message = "Иди нахуй, шпионское отродье"
|
||||
} else if playerRaw.LeagueID == 0 {
|
||||
message = "Заполни профиль и попробуй ещё раз"
|
||||
} else {
|
||||
message += "*Игровой чат Инстинкта*\n"
|
||||
message += "Чат для игр в различные Телеграм-игрушки: https://t.me/joinchat/AAkt5E6bs\\_tGNybxbFMAxA"
|
||||
}
|
||||
|
||||
c.Sender.SendMarkdownAnswer(update, message)
|
||||
|
||||
return constants.UserRequestSuccess
|
||||
}
|
||||
|
||||
// HelpMessage gives user all available commands
|
||||
func (t *Talkers) HelpMessage(update *tgbotapi.Update, playerRaw *dbmapping.Player) string {
|
||||
message := "*Бот Инстинкта Enhanced.*\n\n"
|
||||
@ -67,6 +85,7 @@ func (t *Talkers) HelpMessage(update *tgbotapi.Update, playerRaw *dbmapping.Play
|
||||
message += "\\* /reminders — настроить оповещения на Турнир лиг\n"
|
||||
message += "\\* /academy — Академия Инстинкта\n"
|
||||
message += "\\* /bastion — Бастион Инстинкта\n"
|
||||
message += "\\* /games\\_chat — Игровой чат Инстинкта\n"
|
||||
message += "\\* /faq — получить ответы на часто задаваемые вопросы\n"
|
||||
if c.Users.PlayerBetterThan(playerRaw, "admin") {
|
||||
message += "\\* /send\\_all _текст_ — отправить сообщение всем пользователям бота\n"
|
||||
|
@ -14,6 +14,7 @@ type TalkersInterface interface {
|
||||
|
||||
AcademyMessage(update *tgbotapi.Update, playerRaw *dbmapping.Player) string
|
||||
BastionMessage(update *tgbotapi.Update, playerRaw *dbmapping.Player) string
|
||||
GamesMessage(update *tgbotapi.Update, playerRaw *dbmapping.Player) string
|
||||
HelpMessage(update *tgbotapi.Update, playerRaw *dbmapping.Player) string
|
||||
FAQMessage(update *tgbotapi.Update) string
|
||||
|
||||
|
Reference in New Issue
Block a user