initial prototype, only responds with tokens
This commit is contained in:
parent
d2fd718f22
commit
0ab510adef
5 changed files with 128 additions and 0 deletions
31
main.go
Normal file
31
main.go
Normal file
|
@ -0,0 +1,31 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"mechanus.net/pgobot/matcher"
|
||||
"mechanus.net/pgobot/responder"
|
||||
|
||||
"gopkg.in/telebot.v4"
|
||||
)
|
||||
|
||||
func main() {
|
||||
pref := telebot.Settings{
|
||||
Token: os.Getenv("TOKEN"),
|
||||
Poller: &telebot.LongPoller{Timeout: 10 * time.Second},
|
||||
}
|
||||
|
||||
tokenMatcher := matcher.InitMatcher("tokens.yml")
|
||||
|
||||
bot, err := telebot.NewBot(pref)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
return
|
||||
}
|
||||
|
||||
responder.InitResponder(bot, tokenMatcher)
|
||||
|
||||
bot.Start()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue