initial prototype, only responds with tokens

This commit is contained in:
Von Random 2025-02-09 14:29:04 +02:00
parent d2fd718f22
commit 0ab510adef
5 changed files with 128 additions and 0 deletions

16
responder/responder.go Normal file
View 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, ","))
})
}