Archived
1

Profile parser changes to reflect last bot's update

This commit is contained in:
Vladimir Hodakov 2017-10-14 17:06:54 +04:00
parent d897d2c3f9
commit df58e25adc
2 changed files with 3 additions and 3 deletions

View File

@ -142,9 +142,9 @@ func (p *Parsers) ParseProfile(update tgbotapi.Update, player_raw dbmapping.Play
crystalls_int = p.getPoints(crystalls) crystalls_int = p.getPoints(crystalls)
} }
if strings.HasPrefix(current_string, "🔫Оружие") { if strings.HasPrefix(current_string, "🔫") {
// We need NEXT string! // We need NEXT string!
weapon_type_string := string(profile_info_runed_strings[i + 1]) weapon_type_string := strings.Replace(current_string, "🔫 ", "", 1)
wnRx := regexp.MustCompile("(.+)(ита)") wnRx := regexp.MustCompile("(.+)(ита)")
weapon = wnRx.FindString(weapon_type_string) weapon = wnRx.FindString(weapon_type_string)
} }

View File

@ -43,7 +43,7 @@ func (r *Router) RouteRequest(update tgbotapi.Update) string {
// Forwards // Forwards
var pokememeMsg = regexp.MustCompile("(Уровень)(.+)(Опыт)(.+)\n(Элементы:)(.+)\n(.+)(💙MP)") var pokememeMsg = regexp.MustCompile("(Уровень)(.+)(Опыт)(.+)\n(Элементы:)(.+)\n(.+)(💙MP)")
var profileMsg = regexp.MustCompile("(Онлайн: )(\\d+)\n(Турнир Лиг через)(.+)\n\n(.*)\n(Элементы)(.+)\n\n(.+)(Уровень)(.+)\n") var profileMsg = regexp.MustCompile(`(Онлайн: )(\d+)\n(Турнир через)(.+)\n\n(.*)\n(Элементы)(.+)\n(.*)\n\n(.+)(Уровень)(.+)\n`)
if update.Message.ForwardFrom != nil { if update.Message.ForwardFrom != nil {
if update.Message.ForwardFrom.ID != 360402625 { if update.Message.ForwardFrom.ID != 360402625 {