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)
return "ok"
case update.Message.Command() == "academy":
c.Talkers.AcademyMessage(update)
c.Talkers.AcademyMessage(update, playerRaw)
return "ok"
case update.Message.Command() == "bastion":
c.Talkers.BastionMessage(update)
c.Talkers.BastionMessage(update, playerRaw)
return "ok"
case pokedexMsg.MatchString(text):

View File

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

View File

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