细节优化

This commit is contained in:
🌌 2023-07-23 19:04:24 +08:00
parent bfa67e2deb
commit 57f3741d78
5 changed files with 26 additions and 18 deletions

View File

@ -155,6 +155,12 @@ ws://localhost:2536/GSUIDCore
</details> </details>
<details><summary>代理</summary>
[TRSS-Yunzai Proxy Plugin](../../../Yunzai-Proxy-Plugin)
</details>
6.设置主人:发送 `#设置主人`,后台日志获取验证码并发送 6.设置主人:发送 `#设置主人`,后台日志获取验证码并发送
## 致谢 ## 致谢

View File

@ -443,10 +443,10 @@ Bot.adapter.push(new class ComWeChatAdapter {
load() { load() {
Bot.wss[this.path] = new WebSocketServer({ noServer: true }) Bot.wss[this.path] = new WebSocketServer({ noServer: true })
Bot.wss[this.path].on("connection", ws => { Bot.wss[this.path].on("connection", ws => ws
ws.on("error", logger.error) .on("error", logger.error)
ws.on("message", data => this.message(data, ws)) .on("message", data => this.message(data, ws))
}) )
return true return true
} }
}) })

View File

@ -265,10 +265,10 @@ Bot.adapter.push(new class GSUIDCoreAdapter {
load() { load() {
Bot.wss[this.path] = new WebSocketServer({ noServer: true }) Bot.wss[this.path] = new WebSocketServer({ noServer: true })
Bot.wss[this.path].on("connection", ws => { Bot.wss[this.path].on("connection", ws => ws
ws.on("error", logger.error) .on("error", logger.error)
ws.on("message", data => this.message(data, ws)) .on("message", data => this.message(data, ws))
}) )
return true return true
} }
}) })

View File

@ -852,10 +852,10 @@ Bot.adapter.push(new class gocqhttpAdapter {
load() { load() {
Bot.wss[this.path] = new WebSocketServer({ noServer: true }) Bot.wss[this.path] = new WebSocketServer({ noServer: true })
Bot.wss[this.path].on("connection", ws => { Bot.wss[this.path].on("connection", ws => ws
ws.on("error", logger.error) .on("error", logger.error)
ws.on("message", data => this.message(data, ws)) .on("message", data => this.message(data, ws))
}) )
return true return true
} }
}) })

View File

@ -13,16 +13,18 @@ const list = {
"earth-k-plugin" :"https://gitee.com/SmallK111407/earth-k-plugin", "earth-k-plugin" :"https://gitee.com/SmallK111407/earth-k-plugin",
"xiaofei-plugin" :"https://gitee.com/xfdown/xiaofei-plugin", "xiaofei-plugin" :"https://gitee.com/xfdown/xiaofei-plugin",
"xiaoyao-cvs-plugin":"https://gitee.com/Ctrlcvs/xiaoyao-cvs-plugin", "xiaoyao-cvs-plugin":"https://gitee.com/Ctrlcvs/xiaoyao-cvs-plugin",
"mysVilla-Plugin" :"https://gitee.com/TimeRainStarSky/Yunzai-mysVilla-Plugin",
"Telegram-Plugin" :"https://gitee.com/TimeRainStarSky/Yunzai-Telegram-Plugin", "Telegram-Plugin" :"https://gitee.com/TimeRainStarSky/Yunzai-Telegram-Plugin",
"Discord-Plugin" :"https://gitee.com/TimeRainStarSky/Yunzai-Discord-Plugin", "Discord-Plugin" :"https://gitee.com/TimeRainStarSky/Yunzai-Discord-Plugin",
"QQGuild-Plugin" :"https://gitee.com/TimeRainStarSky/Yunzai-QQGuild-Plugin", "QQGuild-Plugin" :"https://gitee.com/TimeRainStarSky/Yunzai-QQGuild-Plugin",
"WeChat-Plugin" :"https://gitee.com/TimeRainStarSky/Yunzai-WeChat-Plugin", "WeChat-Plugin" :"https://gitee.com/TimeRainStarSky/Yunzai-WeChat-Plugin",
"Proxy-Plugin" :"https://gitee.com/TimeRainStarSky/Yunzai-Proxy-Plugin",
"ICQQ-Plugin" :"https://gitee.com/TimeRainStarSky/Yunzai-ICQQ-Plugin", "ICQQ-Plugin" :"https://gitee.com/TimeRainStarSky/Yunzai-ICQQ-Plugin",
"KOOK-Plugin" :"https://gitee.com/TimeRainStarSky/Yunzai-KOOK-Plugin", "KOOK-Plugin" :"https://gitee.com/TimeRainStarSky/Yunzai-KOOK-Plugin",
} }
export class install extends plugin { export class install extends plugin {
constructor () { constructor() {
super({ super({
name: "安装插件", name: "安装插件",
dsc: "#安装插件 #安装TRSS-Plugin", dsc: "#安装插件 #安装TRSS-Plugin",
@ -37,7 +39,7 @@ export class install extends plugin {
}) })
} }
async install () { async install() {
if (insing) { if (insing) {
await this.reply("已有命令安装中..请勿重复操作") await this.reply("已有命令安装中..请勿重复操作")
return false return false
@ -68,7 +70,7 @@ export class install extends plugin {
this.restart() this.restart()
} }
async execSync (cmd) { async execSync(cmd) {
return new Promise(resolve => { return new Promise(resolve => {
exec(cmd, (error, stdout, stderr) => { exec(cmd, (error, stdout, stderr) => {
resolve({ error, stdout, stderr }) resolve({ error, stdout, stderr })
@ -76,7 +78,7 @@ export class install extends plugin {
}) })
} }
async runInstall (name, url, path) { async runInstall(name, url, path) {
this.isNowUp = false this.isNowUp = false
let cm = `git clone --depth 1 --single-branch "${url}" "${path}"` let cm = `git clone --depth 1 --single-branch "${url}" "${path}"`
@ -99,7 +101,7 @@ export class install extends plugin {
return true return true
} }
async gitErr (err, stdout) { async gitErr(err, stdout) {
let msg = "安装失败!" let msg = "安装失败!"
let errMsg = err.toString() let errMsg = err.toString()
stdout = stdout.toString() stdout = stdout.toString()
@ -119,7 +121,7 @@ export class install extends plugin {
await this.reply([errMsg, stdout]) await this.reply([errMsg, stdout])
} }
restart () { restart() {
new Restart(this.e).restart() new Restart(this.e).restart()
} }
} }