xitiangame / xitian-plugin Goto Github PK
View Code? Open in Web Editor NEW一个Yunzai-Bot(V3)的插件管理器
License: GNU General Public License v3.0
一个Yunzai-Bot(V3)的插件管理器
License: GNU General Public License v3.0
作者大大新年快乐哦,我发现了一个bug~
使用“#安装插件”命令后发送js文件,覆盖安装原有插件,会出现以下错误:
1|Yunzai-Bot | [YzBot][15:29:55.008][ERRO] [插件安装][Msg]
1|Yunzai-Bot | [YzBot][15:29:55.008][ERRO] Error: ENOENT: no such file or directory, rename 'plugins/example私聊测试.js' -> 'plugins/bin/私聊测试.js.bak'
1|Yunzai-Bot | at Object.renameSync (node:fs:1026:3)
1|Yunzai-Bot | at install (file:///usr/local/Yunzai-Bot/plugins/xitian-plugin/module/install.js:90:11)
1|Yunzai-Bot | at processTicksAndRejections (node:internal/process/task_queues:96:5)
1|Yunzai-Bot | at async Install.Msg (file:///usr/local/Yunzai-Bot/plugins/xitian-plugin/apps/Install.js:180:4)
1|Yunzai-Bot | at async PluginsLoader.deal (file:///usr/local/Yunzai-Bot/lib/plugins/loader.js:251:52)
错误发生在xitian-plugin/module/install.js
文件的第90行,这一行的代码是fs.renameSync(`${sameplugin[0].path}${sameplugin[0].file}`, path.join(this.plugins.bin, `${sameplugin[0].file}.bak`))
应该是sameplugin[0].path
中提取到的路径末尾不带斜杠导致的,可以用path.join()
方法把拼接一下。
这里的path
属性好像是由search.js
中的解析插件方法parse()
来赋值的,调用了Node.js的path.parse()
方法,再将这个方法返回的dir
属性赋值给path
,而dir
得到的文件路径末尾是没有斜杠的,所以这里也没有斜杠。
#插件列表
#查看插件[指定插件名称]
这俩个指令都没有检查用户是否是bot主人,会导致倒狗很轻松地获取js插件
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.