Archived
1

Pokememes individual info with search buttons

This commit is contained in:
Vladimir Hodakov
2017-10-07 19:58:14 +04:00
parent 17a03bf8b2
commit 736d6b9658
17 changed files with 159 additions and 15 deletions

View File

@@ -5,7 +5,7 @@ package router
import (
// 3rd party
"gopkg.in/telegram-bot-api.v4"
"github.com/go-telegram-bot-api/telegram-bot-api"
)
type RouterHandler struct {}

View File

@@ -11,7 +11,7 @@ import (
"strings"
"time"
// 3rd party
"gopkg.in/telegram-bot-api.v4"
"github.com/go-telegram-bot-api/telegram-bot-api"
// local
"../dbmappings"
)
@@ -60,6 +60,7 @@ func (r *Router) RouteRequest(update tgbotapi.Update) string {
var helpMsg = regexp.MustCompile("/help\\z")
var helloMsg = regexp.MustCompile("/start\\z")
var pokedexMsg = regexp.MustCompile("/pokede(x|ks)\\d?\\z")
var pokememeInfoMsg = regexp.MustCompile("/pk(\\d+)")
// Forwards
var pokememeMsg = regexp.MustCompile("(Уровень)(.+)(Опыт)(.+)\n(Элементы:)(.+)\n(.+)(💙MP)")
@@ -115,6 +116,8 @@ func (r *Router) RouteRequest(update tgbotapi.Update) string {
} else {
c.Talkers.PokememesList(update, 1)
}
case pokememeInfoMsg.MatchString(text):
c.Talkers.PokememeInfo(update)
// Easter eggs
case huMsg.MatchString(text):
c.Talkers.MatMessage(update)

View File

@@ -5,7 +5,7 @@ package routerinterface
import (
// 3rd party
"gopkg.in/telegram-bot-api.v4"
"github.com/go-telegram-bot-api/telegram-bot-api"
)
type RouterInterface interface {