2024-04-02 20:29:25 +08:00
|
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"bufio"
|
|
|
|
|
"fmt"
|
|
|
|
|
"go-bot/workers"
|
|
|
|
|
"os"
|
|
|
|
|
"strings"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
|
for {
|
|
|
|
|
reader := bufio.NewReader(os.Stdin)
|
2024-06-30 21:56:34 +08:00
|
|
|
|
// cfg := config.GetConfig()
|
|
|
|
|
// config.PrintConfig(cfg, "")
|
2024-04-03 21:53:57 +08:00
|
|
|
|
fmt.Print("输入指令(不要带/):")
|
2024-04-02 20:29:25 +08:00
|
|
|
|
raw_msg, _ := reader.ReadString('\n')
|
|
|
|
|
// 去除末尾的换行符
|
2024-04-14 21:41:50 +08:00
|
|
|
|
// raw_msg = strings.TrimRight(raw_msg, "\r\n")
|
2024-06-30 21:56:34 +08:00
|
|
|
|
if raw_msg == "" {
|
|
|
|
|
raw_msg = "ping"
|
|
|
|
|
}
|
2024-04-14 22:08:50 +08:00
|
|
|
|
parms := strings.Fields(raw_msg)
|
2024-04-02 20:29:25 +08:00
|
|
|
|
|
2024-07-01 10:05:42 +08:00
|
|
|
|
worker := workers.NewWorker(parms, "794508986", "111", "111", "222", raw_msg)
|
|
|
|
|
fmt.Println("TestPermission:", worker.CheckPermission())
|
2024-04-02 20:29:25 +08:00
|
|
|
|
message := worker.GetMsg()
|
|
|
|
|
fmt.Println("message:", message)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|