diff --git a/README.md b/README.md index 279fa88..ba2f243 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,10 @@ Node.js >= 18 / Node.js >= 14(with node-fetch) 推荐使用 git 进行安装,以方便后续升级。在 Yunzai-Bot 根目录夹打开终端,运行下述指令进行安装 -```sh +```shell git clone --depth=1 https://github.com/ikechan8370/chatgpt-plugin.git ./plugins/chatgpt-plugin/ -pnpm install -w undici chatgpt showdown mathjax-node delay uuid remark strip-markdown random puppeteer-extra-plugin-recaptcha puppeteer-extra puppeteer-extra-plugin-stealth @waylaidwanderer/chatgpt-api keyv-file +cd plugins/chatgpt-plugin +pnpm i ``` 如果是手工下载的 zip 压缩包,请将解压后的 chatgpt-plugin 文件夹(请删除压缩自带的-master后缀)放置在 Yunzai-Bot 目录下的 plugins 文件夹内 diff --git a/node_modules/.bin/chatgpt-api b/node_modules/.bin/chatgpt-api new file mode 100755 index 0000000..bf6c169 --- /dev/null +++ b/node_modules/.bin/chatgpt-api @@ -0,0 +1,17 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -z "$NODE_PATH" ]; then + export NODE_PATH="/Users/ikechan8370/Yunzai-Bot/node_modules/.pnpm/node_modules" +else + export NODE_PATH="$NODE_PATH:/Users/ikechan8370/Yunzai-Bot/node_modules/.pnpm/node_modules" +fi +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/@waylaidwanderer+chatgpt-api@1.20.2/node_modules/@waylaidwanderer/chatgpt-api/bin/server.js" "$@" +else + exec node "$basedir/../../../../node_modules/.pnpm/@waylaidwanderer+chatgpt-api@1.20.2/node_modules/@waylaidwanderer/chatgpt-api/bin/server.js" "$@" +fi diff --git a/node_modules/.bin/chatgpt-cli b/node_modules/.bin/chatgpt-cli new file mode 100755 index 0000000..abac332 --- /dev/null +++ b/node_modules/.bin/chatgpt-cli @@ -0,0 +1,17 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -z "$NODE_PATH" ]; then + export NODE_PATH="/Users/ikechan8370/Yunzai-Bot/node_modules/.pnpm/node_modules" +else + export NODE_PATH="$NODE_PATH:/Users/ikechan8370/Yunzai-Bot/node_modules/.pnpm/node_modules" +fi +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/@waylaidwanderer+chatgpt-api@1.20.2/node_modules/@waylaidwanderer/chatgpt-api/bin/cli.js" "$@" +else + exec node "$basedir/../../../../node_modules/.pnpm/@waylaidwanderer+chatgpt-api@1.20.2/node_modules/@waylaidwanderer/chatgpt-api/bin/cli.js" "$@" +fi diff --git a/node_modules/@waylaidwanderer/chatgpt-api b/node_modules/@waylaidwanderer/chatgpt-api new file mode 120000 index 0000000..d29a912 --- /dev/null +++ b/node_modules/@waylaidwanderer/chatgpt-api @@ -0,0 +1 @@ +../../../../node_modules/.pnpm/@waylaidwanderer+chatgpt-api@1.20.2/node_modules/@waylaidwanderer/chatgpt-api \ No newline at end of file diff --git a/package.json b/package.json index b46fc2a..12b265d 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "type": "module", "author": "ikechan8370", "dependencies": { + "@waylaidwanderer/chatgpt-api": "^1.20.2", "chatgpt": "^4.4.1", "delay": "^5.0.0", "keyv-file": "^0.2.0",