Archived
1

/academy and /bastion: some error messages

This commit is contained in:
Vladimir Hodakov 2017-12-02 20:02:27 +04:00
parent 050c0f8d0b
commit 4d941454b5
3 changed files with 26 additions and 10 deletions

View File

@ -52,10 +52,10 @@ func (r *Router) routePrivateRequest(update *tgbotapi.Update, playerRaw *dbmappi
c.Talkers.HelpMessage(update, playerRaw) c.Talkers.HelpMessage(update, playerRaw)
return "ok" return "ok"
case update.Message.Command() == "academy": case update.Message.Command() == "academy":
c.Talkers.AcademyMessage(update) c.Talkers.AcademyMessage(update, playerRaw)
return "ok" return "ok"
case update.Message.Command() == "bastion": case update.Message.Command() == "bastion":
c.Talkers.BastionMessage(update) c.Talkers.BastionMessage(update, playerRaw)
return "ok" return "ok"
case pokedexMsg.MatchString(text): case pokedexMsg.MatchString(text):

View File

@ -10,9 +10,17 @@ import (
) )
// AcademyMessage gives user link to Bastion // AcademyMessage gives user link to Bastion
func (t *Talkers) AcademyMessage(update *tgbotapi.Update) { func (t *Talkers) AcademyMessage(update *tgbotapi.Update, playerRaw *dbmapping.Player) {
message := "*Академия Инстинкта*\n" message := ""
if playerRaw.LeagueID > 1 {
message = "Иди нахуй, шпионское отродье"
} else if playerRaw.LeagueID == 0 {
message = "Заполни профиль и попробуй ещё раз"
} else {
message += "*Академия Инстинкта*\n"
message += "Чат для обучения новичков предумростям игры расположен по ссылке: https://t.me/joinchat/G2vME04jk02v2etRmumylg" message += "Чат для обучения новичков предумростям игры расположен по ссылке: https://t.me/joinchat/G2vME04jk02v2etRmumylg"
}
msg := tgbotapi.NewMessage(update.Message.Chat.ID, message) msg := tgbotapi.NewMessage(update.Message.Chat.ID, message)
msg.ParseMode = "Markdown" msg.ParseMode = "Markdown"
@ -21,9 +29,17 @@ func (t *Talkers) AcademyMessage(update *tgbotapi.Update) {
} }
// BastionMessage gives user link to Bastion // BastionMessage gives user link to Bastion
func (t *Talkers) BastionMessage(update *tgbotapi.Update) { func (t *Talkers) BastionMessage(update *tgbotapi.Update, playerRaw *dbmapping.Player) {
message := "*Бастион Инстинкта*\n" message := ""
if playerRaw.LeagueID > 1 {
message = "Иди нахуй, шпионское отродье"
} else if playerRaw.LeagueID == 0 {
message = "Заполни профиль и попробуй ещё раз"
} else {
message += "*Бастион Инстинкта*\n"
message += "Общий чат лиги расположен по ссылке: https://t.me/joinchat/G2vME0mIX-QHjjxE\\_JBzoQ" message += "Общий чат лиги расположен по ссылке: https://t.me/joinchat/G2vME0mIX-QHjjxE\\_JBzoQ"
}
msg := tgbotapi.NewMessage(update.Message.Chat.ID, message) msg := tgbotapi.NewMessage(update.Message.Chat.ID, message)
msg.ParseMode = "Markdown" msg.ParseMode = "Markdown"

View File

@ -12,8 +12,8 @@ import (
type TalkersInterface interface { type TalkersInterface interface {
Init() Init()
AcademyMessage(update *tgbotapi.Update) AcademyMessage(update *tgbotapi.Update, playerRaw *dbmapping.Player)
BastionMessage(update *tgbotapi.Update) BastionMessage(update *tgbotapi.Update, playerRaw *dbmapping.Player)
HelpMessage(update *tgbotapi.Update, playerRaw *dbmapping.Player) HelpMessage(update *tgbotapi.Update, playerRaw *dbmapping.Player)
AnyMessageUnauthorized(update *tgbotapi.Update) string AnyMessageUnauthorized(update *tgbotapi.Update) string