feat: gateway
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/promote/production Build is passing

This commit is contained in:
vaalacat
2024-04-23 11:18:16 +00:00
parent a42fecfc63
commit 75944abbc2
13 changed files with 404 additions and 87 deletions

View File

@@ -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")