Archived
1

Format imports with goimport

This commit is contained in:
2018-05-02 07:25:39 +04:00
parent ef9cf07abc
commit 86afa52a56
43 changed files with 108 additions and 128 deletions

View File

@@ -4,18 +4,19 @@
package forwarder
import (
"github.com/go-telegram-bot-api/telegram-bot-api"
"regexp"
"github.com/go-telegram-bot-api/telegram-bot-api"
"source.wtfteam.pro/i2_bot/i2_bot/lib/dbmapping"
)
// ProcessForward process forwards for single-user chats
func (f *Forwarder) ProcessForward(update *tgbotapi.Update, playerRaw *dbmapping.Player) string {
text := update.Message.Text
// Forwards
var pokememeMsg = regexp.MustCompile(`Dex(.+)\nGrade(.+)\nName(.+)`)
var profileMsg = regexp.MustCompile(`(Онлайн: )(\d+)(| Турнир: )(.+)\n(.+)\n(.+)\n(👤Уровень)(.+)\n`)
var profileWithEffectsMsg = regexp.MustCompile(`(Онлайн: )(\d+)(| Турнир: )(.+)\n(.+)\n(.+)\n(.+)\n(👤Уровень)(.+)\n`)
var profileMsg = regexp.MustCompile(`id(\s)(\d+)\n(Team)(\s)([А-Я]+)\nName(\s)(.*)\nLvl(\s)(\d+)`)
switch {
case pokememeMsg.MatchString(text):
@@ -28,8 +29,6 @@ func (f *Forwarder) ProcessForward(update *tgbotapi.Update, playerRaw *dbmapping
case profileMsg.MatchString(text):
c.Log.Debug("Profile posted!")
return c.Users.ParseProfile(update, playerRaw)
case profileWithEffectsMsg.MatchString(text):
return c.Users.ProfileAddEffectsMessage(update)
default:
c.Log.Debug(text)
}