From bd44755a1bf0ebe13d309d9d837b04696b837031 Mon Sep 17 00:00:00 2001 From: leo <426742@gmail.com> Date: Sun, 25 Aug 2024 17:54:23 +0500 Subject: [PATCH] create --- .dockerignore | 3 + .gitignore | 1 + Dockerfile | 11 ++ LICENSE.md | 4 + README.md | 21 +++ allowed.list | 0 docker-compose.yml | 16 ++ logo-open-ai.png | Bin 0 -> 27992 bytes package-lock.json | 452 +++++++++++++++++++++++++++++++++++++++++++++ package.json | 21 +++ src/hello.txt | 23 +++ src/index.js | 106 +++++++++++ 12 files changed, 658 insertions(+) create mode 100644 .dockerignore create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 LICENSE.md create mode 100644 README.md create mode 100755 allowed.list create mode 100644 docker-compose.yml create mode 100644 logo-open-ai.png create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 src/hello.txt create mode 100644 src/index.js diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..7a2cbe4 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +/node_modules +docker-compose.yml +logo-open-ai.png \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5df9774 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM node:22.7.0-alpine3.19 + +WORKDIR /app + +COPY package*.json ./ + +RUN npm install + +COPY /src /app/src + +ENV NODE_PATH=./node_modules diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..58d820d --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,4 @@ + +All Rights Reserved + +This code is the property of Leo. Unauthorized copying, distribution, modification, or any other use is strictly prohibited. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..1d55c0c --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ + + +#### Запустить контейнер: + +`APP_INSTANCE=4o docker compose up -d` + +где 4o - имя запускаемого экземпляра, например: +* 4o (ChatGPT 4o) +* 35 (ChatGPT 3.5) +* in (ChatGPT instruct) + +Для каждого хоста и экземпляра настраивается своя конфигурация, которая находится в: + +`/data/secrets/${SERVER_DOMAIN}/tgbot-chatgpt/${APP_INSTANCE}/` + + +#### Сервисные команды: + +Запустить с указанием `APP_INSTANCE`: `APP_INSTANCE=4o docker compose up` +Пересоздать образ: `APP_INSTANCE=4o docker compose up --build --force-recreate` +Открыть консоль запущенного контейнера `docker exec -it tgbot-chatgpt-4o /bin/sh` diff --git a/allowed.list b/allowed.list new file mode 100755 index 0000000..e69de29 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..8be6f05 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,16 @@ +services: + tgbot-chatgpt: + container_name: tgbot-chatgpt-${APP_INSTANCE} + build: + context: . + env_file: + - /data/secrets/${SERVER_DOMAIN}/tgbot-chatgpt/${APP_INSTANCE}/app.env + volumes: + - .:/app:rw + - app_node_modules:/app/node_modules + - /data/secrets/${SERVER_DOMAIN}/tgbot-chatgpt/${APP_INSTANCE}/allowed.list:/app/allowed.list:ro + command: npm run start + restart: always +volumes: + node_modules: + app_node_modules: \ No newline at end of file diff --git a/logo-open-ai.png b/logo-open-ai.png new file mode 100644 index 0000000000000000000000000000000000000000..f5d3b3dec7161a855c28e5dac3ff2d46718539b0 GIT binary patch literal 27992 zcmeFZ`9GBH-#>m@N<*a!rIor0AxntJ7L|;#&LF$Wk}a|%!yqZeRTP7h_OcGyXG{j;draN;b-zEK$LBBjKJK49Ff-?I9_MR$zMjwLF;7g4^!D%`=7k_= zkN(w5W)Q@k2SJ>ZyLN)V{MGpIIQVhM|ME3|q_>NI;B{YT=%SPN4d>(fUe{fn&77}0 z1>I?OR)-)@rv9aisCxrHhrRRd0!ZS&oUw{1q(Zu#($J5)2{8pCW|hunGxDZoIin2x1(EnPr^R@`HD+;@rs#R`{*qdTQ*lEeT4Q|YI34w(mN9C{jwWd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x#qGv*!GH5ZW1%WCMO*uJ=b>4=m_c>+GHFZYNu#3qt=+}up;7UCQ~DX| zo$&tvZA=9OFjA&n0#gC=KQP@c58BY?CGJQwp=f=@-96&(05jz86#k+T5C*O`&L{RZ z>rA`zz@bNP6e*CqHE2t|kg#7;-_;v*AAV$|?5)rQG73yHrRkaX#m(3sl7b;-<8UO$Q literal 0 HcmV?d00001 diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..1f2d29a --- /dev/null +++ b/package-lock.json @@ -0,0 +1,452 @@ +{ + "name": "tgbot-chatgpt", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "tgbot-chatgpt", + "version": "1.0.0", + "license": "All Rights Reserved", + "dependencies": { + "openai": "^4.56.0", + "socks-proxy-agent": "^8.0.4", + "telegraf": "^4.16.3" + } + }, + "node_modules/@telegraf/types": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@telegraf/types/-/types-7.1.0.tgz", + "integrity": "sha512-kGevOIbpMcIlCDeorKGpwZmdH7kHbqlk/Yj6dEpJMKEQw5lk0KVQY0OLXaCswy8GqlIVLd5625OB+rAntP9xVw==", + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "18.19.45", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.45.tgz", + "integrity": "sha512-VZxPKNNhjKmaC1SUYowuXSRSMGyQGmQjvvA1xE4QZ0xce2kLtEhPDS+kqpCPBZYgqblCLQ2DAjSzmgCM5auvhA==", + "license": "MIT", + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/node-fetch": { + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.11.tgz", + "integrity": "sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==", + "license": "MIT", + "dependencies": { + "@types/node": "*", + "form-data": "^4.0.0" + } + }, + "node_modules/abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "license": "MIT", + "dependencies": { + "event-target-shim": "^5.0.0" + }, + "engines": { + "node": ">=6.5" + } + }, + "node_modules/agent-base": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", + "license": "MIT", + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/agentkeepalive": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.5.0.tgz", + "integrity": "sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==", + "license": "MIT", + "dependencies": { + "humanize-ms": "^1.2.1" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, + "node_modules/buffer-alloc": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", + "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", + "license": "MIT", + "dependencies": { + "buffer-alloc-unsafe": "^1.1.0", + "buffer-fill": "^1.0.0" + } + }, + "node_modules/buffer-alloc-unsafe": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", + "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==", + "license": "MIT" + }, + "node_modules/buffer-fill": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", + "integrity": "sha512-T7zexNBwiiaCOGDg9xNX9PBmjrubblRkENuptryuI64URkXDFum9il/JGL8Lm8wYfAXpredVXXZz7eMHilimiQ==", + "license": "MIT" + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/debug": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/debug/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "license": "MIT" + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/form-data-encoder": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-1.7.2.tgz", + "integrity": "sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A==", + "license": "MIT" + }, + "node_modules/formdata-node": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/formdata-node/-/formdata-node-4.4.1.tgz", + "integrity": "sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==", + "license": "MIT", + "dependencies": { + "node-domexception": "1.0.0", + "web-streams-polyfill": "4.0.0-beta.3" + }, + "engines": { + "node": ">= 12.20" + } + }, + "node_modules/humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.0.0" + } + }, + "node_modules/ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "license": "MIT", + "dependencies": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==", + "license": "MIT" + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mri": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", + "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "engines": { + "node": ">=10.5.0" + } + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/openai": { + "version": "4.56.0", + "resolved": "https://registry.npmjs.org/openai/-/openai-4.56.0.tgz", + "integrity": "sha512-zcag97+3bG890MNNa0DQD9dGmmTWL8unJdNkulZzWRXrl+QeD+YkBI4H58rJcwErxqGK6a0jVPZ4ReJjhDGcmw==", + "license": "Apache-2.0", + "dependencies": { + "@types/node": "^18.11.18", + "@types/node-fetch": "^2.6.4", + "abort-controller": "^3.0.0", + "agentkeepalive": "^4.2.1", + "form-data-encoder": "1.7.2", + "formdata-node": "^4.3.2", + "node-fetch": "^2.6.7" + }, + "bin": { + "openai": "bin/cli" + }, + "peerDependencies": { + "zod": "^3.23.8" + }, + "peerDependenciesMeta": { + "zod": { + "optional": true + } + } + }, + "node_modules/p-timeout": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-4.1.0.tgz", + "integrity": "sha512-+/wmHtzJuWii1sXn3HCuH/FTwGhrp4tmJTxSKJbfS+vkipci6osxXM5mY0jUiRzWKMTgUT8l7HFbeSwZAynqHw==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/safe-compare": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/safe-compare/-/safe-compare-1.1.4.tgz", + "integrity": "sha512-b9wZ986HHCo/HbKrRpBJb2kqXMK9CEWIE1egeEvZsYn69ay3kdfl9nG3RyOcR+jInTDf7a86WQ1d4VJX7goSSQ==", + "license": "MIT", + "dependencies": { + "buffer-alloc": "^1.2.0" + } + }, + "node_modules/sandwich-stream": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/sandwich-stream/-/sandwich-stream-2.0.2.tgz", + "integrity": "sha512-jLYV0DORrzY3xaz/S9ydJL6Iz7essZeAfnAavsJ+zsJGZ1MOnsS52yRjU3uF3pJa/lla7+wisp//fxOwOH8SKQ==", + "license": "Apache-2.0", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "license": "MIT", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.3.tgz", + "integrity": "sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==", + "license": "MIT", + "dependencies": { + "ip-address": "^9.0.5", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.4.tgz", + "integrity": "sha512-GNAq/eg8Udq2x0eNiFkr9gRg5bA7PXEWagQdeRX4cPSG+X/8V38v637gim9bjFptMk1QWsCTr0ttrJEiXbNnRw==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.1", + "debug": "^4.3.4", + "socks": "^2.8.3" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", + "license": "BSD-3-Clause" + }, + "node_modules/telegraf": { + "version": "4.16.3", + "resolved": "https://registry.npmjs.org/telegraf/-/telegraf-4.16.3.tgz", + "integrity": "sha512-yjEu2NwkHlXu0OARWoNhJlIjX09dRktiMQFsM678BAH/PEPVwctzL67+tvXqLCRQQvm3SDtki2saGO9hLlz68w==", + "license": "MIT", + "dependencies": { + "@telegraf/types": "^7.1.0", + "abort-controller": "^3.0.0", + "debug": "^4.3.4", + "mri": "^1.2.0", + "node-fetch": "^2.7.0", + "p-timeout": "^4.1.0", + "safe-compare": "^1.1.4", + "sandwich-stream": "^2.0.2" + }, + "bin": { + "telegraf": "lib/cli.mjs" + }, + "engines": { + "node": "^12.20.0 || >=14.13.1" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "license": "MIT" + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "license": "MIT" + }, + "node_modules/web-streams-polyfill": { + "version": "4.0.0-beta.3", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.3.tgz", + "integrity": "sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==", + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "license": "BSD-2-Clause" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..6d02299 --- /dev/null +++ b/package.json @@ -0,0 +1,21 @@ +{ + "name": "tgbot-chatgpt", + "version": "1.0.0", + "description": "Simple Telegram bot for access ChatGPT OpenAi API", + "author": "Leo", + "license": "All Rights Reserved", + "main": "index.js", + "type": "module", + "scripts": { + "start": "node ./src/index.js" + }, + "dependencies": { + "openai": "^4.56.0", + "socks-proxy-agent": "^8.0.4", + "telegraf": "^4.16.3" + }, + "repository": { + "type": "git", + "url": "https://git.rozenlab.com/leo/tgbot-chatgpt" + } +} diff --git a/src/hello.txt b/src/hello.txt new file mode 100644 index 0000000..c82cff4 --- /dev/null +++ b/src/hello.txt @@ -0,0 +1,23 @@ +Я — искусственный интеллект от OpenAI, созданный для помощи людям с самыми разными запросами. Вот лишь некоторые вещи, которые я могу делать: + +1. **Ответы на вопросы**: Я могу давать точные и информативные ответы на множество вопросов, будь то общие знания, научная информация, исторические данные, культурные факты и многое другое. + +2. **Языковая поддержка**: Я могу перевести тексты на различные языки, помогать с изучением и практикой иностранных языков. + +3. **Обучение и консультации**: Я могу разъяснять сложные темы, помочь с домашним заданием и предоставить ресурсы для самостоятельного обучения. + +4. **Поддержка в письме**: Я могу помочь в составлении писем, статей, рефератов, резюме и других текстов. + +5. **Программирование**: Я могу помочь программистам с кодом, объяснить концепты программирования и поделиться примерами кода. + +6. **Развлечение**: Я могу рассказывать шутки, истории, создавать стихи и многое другое для развлечения. + +7. **Эмоциональная поддержка и советы**: Я стремлюсь быть неким "цифровым товарищем", который может предложить утешение или совет. + +8. **Поиск и исследования**: Я могу помочь найти информацию или провести небольшое исследование по вашему запросу. + +9. **Планирование и организация**: Я могу помочь в планировании поездок, управлении временем, списками задач и напоминаниями. + +10. **Советы по приготовлению пищи**: Я могу предложить рецепты, объяснить техники приготовления и дать советы по замене ингредиентов. + +Мои возможности постоянно расширяются, так как я продолжаю учиться на основе новых данных и обратной связи от пользователей. Если у вас есть конкретный вопрос или задача, попробуйте спросить, и я постараюсь помочь! \ No newline at end of file diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..0a175f6 --- /dev/null +++ b/src/index.js @@ -0,0 +1,106 @@ +import { Telegraf } from 'telegraf'; +import { message } from 'telegraf/filters'; +import { code } from 'telegraf/format'; +import OpenAI from 'openai'; +import { promises as fs } from 'fs'; +import { SocksProxyAgent } from 'socks-proxy-agent'; + +const proxyEnable = process.env.PROXY_ENABLE; +let proxyConfig = {}; + +const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY }); +const timeout = parseInt(process.env.TIMEOUT, 10); +let allowedUsers = []; + +if(proxyEnable === 'true') { + const proxyHost = process.env.PROXY_HOST; + const proxyPort = process.env.PROXY_PORT; + const proxyLogin = process.env.PROXY_LOGIN; + const proxyPassword = process.env.PROXY_PASSWORD; + const proxyOptions = `socks5://${proxyLogin}:${proxyPassword}@${proxyHost}:${proxyPort}`; + const proxyAgent = new SocksProxyAgent(proxyOptions); + proxyConfig = { httpAgent: proxyAgent, httpsAgent: proxyAgent }; +} + +const bot = new Telegraf( + process.env.BOT_TOKEN, + { handlerTimeout: timeout } + ); + +bot.command('new', initCommand); +bot.command('help', initCommand); +bot.command('start', initCommand); + +async function chatGPT(content) { + try { + const chatCompletion = await openai.chat.completions.create({ + messages: [{ role: 'user', content }], + model: process.env.GPT_MODEL, + }, proxyConfig); + return chatCompletion.choices[0].message.content; + } catch (e) { + console.log('Error while gpt chat', e.message); + } +} + +bot.on(message('text'), async (ctx) => { + if (await auth(ctx.message.from.id)) { + try { + await ctx.reply(code('🕰️⏰🕙⏱️⏳...')); + const responce = await chatGPT(ctx.message.text); + if(responce) { + await ctx.reply(responce); + } else { + await ctx.reply("Не могу ответить"); + } + } catch (e) { + console.log('Error GPT', e.message); + } + } else { + await ctx.reply(code(`Access denied for ${ctx.message.from.first_name} (${ctx.message.from.id})`)); + } +}); + +async function fileToString(filePath) { + try { + return await fs.readFile(filePath, { encoding: 'utf-8' }); + } catch { + return 'Error'; + } +} + +async function initCommand(ctx) { + const helloText = await fileToString(process.env.HELLO_FILE); + await ctx.reply(helloText); +} + +async function auth(fromId) { + try { + return allowedUsers.includes(fromId); + } catch(error) { + console.error(error); + return false; + } +} + +async function loadAllowedIds(filePath) { + try { + const data = await fileToString(filePath); + const lines = data.split('\n'); + return lines + .map(line => line.split('//')[0].trim()) + .filter(line => line.length > 0) + .map(line => parseInt(line, 10)) + .filter(id => !isNaN(id)); + } catch (err) { + console.error(err); + return []; + } +} + +async function start() { + allowedUsers = await loadAllowedIds(process.env.ALLOWED_FILE); + await bot.launch(); +} + +start(); \ No newline at end of file