Skip to content

Commit

Permalink
[-] remove maihook function
Browse files Browse the repository at this point in the history
  • Loading branch information
moyoez committed May 8, 2024
1 parent 7ac0db4 commit e67025f
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 558 deletions.
223 changes: 0 additions & 223 deletions Backend/main.go

This file was deleted.

24 changes: 1 addition & 23 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@
package main

import (
"fmt"
"net/http"
"os"
"time"

"github.com/joho/godotenv"

backend "github.com/MoYoez/Lucy-QOnebot/Backend"
"github.com/MoYoez/Lucy-QOnebot/kanban" // 在最前打印 banner
_ "github.com/MoYoez/Lucy-QOnebot/plugin/bottle" // 漂流瓶
_ "github.com/MoYoez/Lucy-QOnebot/plugin/manager" // 群管
Expand Down Expand Up @@ -60,31 +57,12 @@ func main() {
Handle(func(ctx *zero.Ctx) {
ctx.SendChain(message.Text(kanban.Banner))
})
// USAGE : Lucy's Backend Server
http.Handle("/", backend.AuthCode(http.HandlerFunc(backend.AliveTest)))
http.Handle("/api/cici/queryid", backend.AuthCode(http.HandlerFunc(backend.ReturnUserList)))
http.Handle("/api/cici/updater", backend.AuthCode(http.HandlerFunc(backend.Updater)))
port := 51608
address := fmt.Sprintf(":%d", port)
go http.ListenAndServe(address, nil)
go zero.RunAndBlock(&zero.Config{
zero.RunAndBlock(&zero.Config{
NickName: append([]string{os.Getenv("name")}, "Lucy", "lucy", "Lucy酱"),
CommandPrefix: "/",
SuperUsers: []int64{1292581422},
Driver: []zero.Driver{driver.NewWebSocketClient("ws://127.0.0.1:6700", "")},
MaxProcessTime: time.Minute * 4,
RingLen: 0,
}, process.GlobalInitMutex.Unlock)

fmt.Print("#### RUN SERVER BACKEND\n")
fmt.Printf("Server is running on https://localhost:%d\n", port)
backend.SongUpdater()
timer := time.NewTimer(time.Until(backend.GetNextExecutionTime()))
go func() {
for range timer.C {
backend.SongUpdater()
timer.Reset(time.Until(backend.GetNextExecutionTime()))
}
}()
select {}
}
Loading

0 comments on commit e67025f

Please sign in to comment.