initial prototype, only responds with tokens
This commit is contained in:
parent
d2fd718f22
commit
0ab510adef
5 changed files with 128 additions and 0 deletions
16
responder/responder.go
Normal file
16
responder/responder.go
Normal file
|
@ -0,0 +1,16 @@
|
|||
package responder
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"mechanus.net/pgobot/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, ","))
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue