This commit is contained in:
1-6
2023-07-25 16:43:15 +08:00
parent fd2053e14c
commit 3a09771432
9 changed files with 272 additions and 40 deletions
+13 -5
View File
@@ -65,14 +65,22 @@ func main() {
if t {
core.Logs.Info("Terminal机器人已连接")
scanner := bufio.NewScanner(os.Stdin)
a := &core.Factory{}
a.Init("terminal", "default", nil)
a.SetReplyHandler(func(m map[string]interface{}) string {
fmt.Printf("\x1b[%dm%s \x1b[0m\n", 31, m[core.CONETNT])
return ""
})
for scanner.Scan() {
data := scanner.Text()
f := &core.Faker{
Type: "terminal",
Message: string(data),
Admin: true,
s := &core.CustomSender{
// Type: "terminal",
// Message: string(data),
// Admin: true,
F: a,
}
core.Messages <- f
s.SetContent(data)
core.Messages <- s
}
core.Logs.Info("Terminal机器人异常,请检查运行环境设置,如果是docker环境,请附加-it参数")
} else {