1
0
mirror of https://github.com/pinpox/gitea-matrix-bot synced 2024-11-22 19:31:58 +01:00
gitea-matrix-bot/main.go
2019-04-14 20:43:16 +02:00

40 lines
648 B
Go

package main
import (
"fmt"
"github.com/go-ini/ini"
"os"
)
// import "net/http"
var cfg *ini.File
var err error
var bot *GiteaBot
func init() {
//Lonad config
cfg, err = ini.Load("config.ini")
if err != nil {
fmt.Printf("Fail to read file: %v", err)
os.Exit(1)
}
matrixUser := cfg.Section("matrix").Key("matrix_user").String()
matrixPass := cfg.Section("matrix").Key("matrix_pass").String()
// botDB := cfg.Section("bot").Key("").String()
fmt.Println("Creating Bot")
bot, err = NewGiteaBot(matrixUser, matrixPass)
if err != nil {
panic(err)
}
}
func main() {
fmt.Println("Setting up POST-listener")
setupListener()
}