go-bot/test/test.go

28 lines
530 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package main
import (
"bufio"
"fmt"
"go-bot/workers"
"os"
"strings"
)
func main() {
for {
reader := bufio.NewReader(os.Stdin)
fmt.Print("输入指令(不要带/)")
raw_msg, _ := reader.ReadString('\n')
// 去除末尾的换行符
raw_msg = strings.TrimRight(raw_msg, "\r\n")
parms := strings.Split(raw_msg, " ")
worker := workers.NewWorker(parms, "11", "111", "111", "222", raw_msg)
fmt.Println("Test:", worker.CheckPermission())
message := worker.GetMsg()
fmt.Println("message:", message)
}
}