16 lines
328 B
Go
16 lines
328 B
Go
package responder
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"mechanus.net/pgbot/matcher"
|
|
|
|
"gopkg.in/telebot.v4"
|
|
)
|
|
|
|
func InitResponder(bot *telebot.Bot, tokenMatcher *matcher.Matcher) {
|
|
bot.Handle(telebot.OnText, func(c telebot.Context) error {
|
|
tokens := tokenMatcher.Tokenize(c.Message().Text)
|
|
return c.Send(strings.Join(tokens, ","))
|
|
})
|
|
}
|