Archived
1

Explicit error message for profile posting with enabled artifacts

This commit is contained in:
2018-01-23 20:50:21 +04:00
parent c5d8590b87
commit b7379013a8
5 changed files with 22 additions and 4 deletions

View File

@@ -79,6 +79,19 @@ func (u *Users) ForeignProfileMessage(update *tgbotapi.Update) string {
return u.ProfileMessage(update, &playerRaw)
}
// ProfileAddEffectsMesage shows when user tries to post profile with effects enabled
func (u *Users) ProfileAddEffectsMessage(update *tgbotapi.Update) string {
message := "*Наркоман, штоле?*\n\n"
message += "Бот не принимает профили во время активированных эффектов. Закончи свои дела и принеси чистый профиль через полчаса."
msg := tgbotapi.NewMessage(update.Message.Chat.ID, message)
msg.ParseMode = "Markdown"
c.Bot.Send(msg)
return "fail"
}
// ProfileMessage shows current player's profile
func (u *Users) ProfileMessage(update *tgbotapi.Update, playerRaw *dbmapping.Player) string {
profileRaw, ok := u.GetProfile(playerRaw.ID)

View File

@@ -24,6 +24,7 @@ type UsersInterface interface {
FindByName(update *tgbotapi.Update) string
ForeignProfileMessage(update *tgbotapi.Update) string
FormatUsername(userName string) string
ProfileAddEffectsMessage(update *tgbotapi.Update) string
ProfileMessage(update *tgbotapi.Update, playerRaw *dbmapping.Player) string
UsersList(update *tgbotapi.Update) string
}