Git Product home page Git Product logo

xitian-plugin's People

Contributors

xitiangame avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

xitian-plugin's Issues

覆盖安装插件时重命名文件出错

作者大大新年快乐哦,我发现了一个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插件

插件列表能否只显示js后缀文件

bc6d0d89b6e3fb2ad22d5ed03f574365
因为有一个插件需要pnpm拉取依赖,在example目录下拉取后出现了node_modules,pnpm-lock等等文件,导致插件列表中把这些也显示了
能否改成只显示js后缀名的插件

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.