telegabber/telegabber.go

30 lines
605 B
Go

package main
import (
"dev.narayana.im/narayana/telegabber/config"
"dev.narayana.im/narayana/telegabber/xmpp"
log "github.com/sirupsen/logrus"
)
// YAML config, compatible with the format of Zhabogram 2.0.0
const configPath string = "config.yml"
// JSON schema (not for editing by a user)
const schemaPath string = "./config_schema.json"
func main() {
config, err := config.ReadConfig(configPath, schemaPath)
if err != nil {
log.Fatal(err)
}
cm, err := xmpp.NewComponent(config.XMPP, config.Telegram)
if err != nil {
log.Fatal(err)
}
// reconnect automatically
log.Fatal(cm.Run())
}