feat: gateway
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"log"
|
||||
"strings"
|
||||
"tg-mc/conf"
|
||||
"tg-mc/services/utils"
|
||||
"time"
|
||||
|
||||
"github.com/Tnze/go-mc/bot"
|
||||
@@ -17,6 +18,15 @@ import (
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
func StartBridgeClient() {
|
||||
for {
|
||||
if err := Run(); err != nil {
|
||||
utils.SendMsg("致命错误:" + err.Error())
|
||||
}
|
||||
time.Sleep(time.Second * 5)
|
||||
}
|
||||
}
|
||||
|
||||
func Run() error {
|
||||
conf.Client = bot.NewClient()
|
||||
conf.Client.Auth.Name = conf.GetBotSettings().MCBotName
|
||||
@@ -44,7 +54,8 @@ func Run() error {
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
log.Printf("joinserver error: %v", err)
|
||||
return err
|
||||
}
|
||||
|
||||
log.Println("Login success")
|
||||
|
||||
Reference in New Issue
Block a user