Commit ·
3365795
1
Parent(s): c3953cb
Upload 10 files
Browse files- .dockerignore +324 -0
- .env.example +7 -0
- .gitignore +326 -0
- Dockerfile +14 -0
- README.md +191 -3
- README_ZH.md +194 -0
- docker-compose.yml +9 -0
- package-lock.json +0 -0
- package.json +42 -0
- tsconfig.json +101 -0
.dockerignore
ADDED
|
@@ -0,0 +1,324 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Created by https://www.toptal.com/developers/gitignore/api/node
|
| 2 |
+
# Edit at https://www.toptal.com/developers/gitignore?templates=node
|
| 3 |
+
|
| 4 |
+
### Node ###
|
| 5 |
+
# Logs
|
| 6 |
+
logs
|
| 7 |
+
*.log
|
| 8 |
+
npm-debug.log*
|
| 9 |
+
yarn-debug.log*
|
| 10 |
+
yarn-error.log*
|
| 11 |
+
lerna-debug.log*
|
| 12 |
+
.pnpm-debug.log*
|
| 13 |
+
|
| 14 |
+
# Diagnostic reports (https://nodejs.org/api/report.html)
|
| 15 |
+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
| 16 |
+
|
| 17 |
+
# Runtime data
|
| 18 |
+
pids
|
| 19 |
+
*.pid
|
| 20 |
+
*.seed
|
| 21 |
+
*.pid.lock
|
| 22 |
+
|
| 23 |
+
# Directory for instrumented libs generated by jscoverage/JSCover
|
| 24 |
+
lib-cov
|
| 25 |
+
|
| 26 |
+
# Coverage directory used by tools like istanbul
|
| 27 |
+
coverage
|
| 28 |
+
*.lcov
|
| 29 |
+
|
| 30 |
+
# nyc test coverage
|
| 31 |
+
.nyc_output
|
| 32 |
+
|
| 33 |
+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
| 34 |
+
.grunt
|
| 35 |
+
|
| 36 |
+
# Bower dependency directory (https://bower.io/)
|
| 37 |
+
bower_components
|
| 38 |
+
|
| 39 |
+
# node-waf configuration
|
| 40 |
+
.lock-wscript
|
| 41 |
+
|
| 42 |
+
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
| 43 |
+
build/Release
|
| 44 |
+
|
| 45 |
+
# Dependency directories
|
| 46 |
+
node_modules/
|
| 47 |
+
jspm_packages/
|
| 48 |
+
|
| 49 |
+
# Snowpack dependency directory (https://snowpack.dev/)
|
| 50 |
+
web_modules/
|
| 51 |
+
|
| 52 |
+
# TypeScript cache
|
| 53 |
+
*.tsbuildinfo
|
| 54 |
+
|
| 55 |
+
# Optional npm cache directory
|
| 56 |
+
.npm
|
| 57 |
+
|
| 58 |
+
# Optional eslint cache
|
| 59 |
+
.eslintcache
|
| 60 |
+
|
| 61 |
+
# Optional stylelint cache
|
| 62 |
+
.stylelintcache
|
| 63 |
+
|
| 64 |
+
# Microbundle cache
|
| 65 |
+
.rpt2_cache/
|
| 66 |
+
.rts2_cache_cjs/
|
| 67 |
+
.rts2_cache_es/
|
| 68 |
+
.rts2_cache_umd/
|
| 69 |
+
|
| 70 |
+
# Optional REPL history
|
| 71 |
+
.node_repl_history
|
| 72 |
+
|
| 73 |
+
# Output of 'npm pack'
|
| 74 |
+
*.tgz
|
| 75 |
+
|
| 76 |
+
# Yarn Integrity file
|
| 77 |
+
.yarn-integrity
|
| 78 |
+
|
| 79 |
+
# dotenv environment variable files
|
| 80 |
+
.env
|
| 81 |
+
.env.development.local
|
| 82 |
+
.env.test.local
|
| 83 |
+
.env.production.local
|
| 84 |
+
.env.local
|
| 85 |
+
|
| 86 |
+
# parcel-bundler cache (https://parceljs.org/)
|
| 87 |
+
.cache
|
| 88 |
+
.parcel-cache
|
| 89 |
+
|
| 90 |
+
# Next.js build output
|
| 91 |
+
.next
|
| 92 |
+
out
|
| 93 |
+
|
| 94 |
+
# Nuxt.js build / generate output
|
| 95 |
+
.nuxt
|
| 96 |
+
dist
|
| 97 |
+
|
| 98 |
+
# Gatsby files
|
| 99 |
+
.cache/
|
| 100 |
+
# Comment in the public line in if your project uses Gatsby and not Next.js
|
| 101 |
+
# https://nextjs.org/blog/next-9-1#public-directory-support
|
| 102 |
+
# public
|
| 103 |
+
|
| 104 |
+
# vuepress build output
|
| 105 |
+
.vuepress/dist
|
| 106 |
+
|
| 107 |
+
# vuepress v2.x temp and cache directory
|
| 108 |
+
.temp
|
| 109 |
+
|
| 110 |
+
# Docusaurus cache and generated files
|
| 111 |
+
.docusaurus
|
| 112 |
+
|
| 113 |
+
# Serverless directories
|
| 114 |
+
.serverless/
|
| 115 |
+
|
| 116 |
+
# FuseBox cache
|
| 117 |
+
.fusebox/
|
| 118 |
+
|
| 119 |
+
# DynamoDB Local files
|
| 120 |
+
.dynamodb/
|
| 121 |
+
|
| 122 |
+
# TernJS port file
|
| 123 |
+
.tern-port
|
| 124 |
+
|
| 125 |
+
# Stores VSCode versions used for testing VSCode extensions
|
| 126 |
+
.vscode-test
|
| 127 |
+
|
| 128 |
+
# yarn v2
|
| 129 |
+
.yarn/cache
|
| 130 |
+
.yarn/unplugged
|
| 131 |
+
.yarn/build-state.yml
|
| 132 |
+
.yarn/install-state.gz
|
| 133 |
+
.pnp.*
|
| 134 |
+
|
| 135 |
+
### Node Patch ###
|
| 136 |
+
# Serverless Webpack directories
|
| 137 |
+
.webpack/
|
| 138 |
+
|
| 139 |
+
# Optional stylelint cache
|
| 140 |
+
|
| 141 |
+
# SvelteKit build / generate output
|
| 142 |
+
.svelte-kit
|
| 143 |
+
|
| 144 |
+
# End of https://www.toptal.com/developers/gitignore/api/node
|
| 145 |
+
n
|
| 146 |
+
*memory-card.json
|
| 147 |
+
# Created by https://www.toptal.com/developers/gitignore/api/python
|
| 148 |
+
# Edit at https://www.toptal.com/developers/gitignore?templates=python
|
| 149 |
+
|
| 150 |
+
### Python ###
|
| 151 |
+
# Byte-compiled / optimized / DLL files
|
| 152 |
+
__pycache__/
|
| 153 |
+
*.py[cod]
|
| 154 |
+
*$py.class
|
| 155 |
+
|
| 156 |
+
# C extensions
|
| 157 |
+
*.so
|
| 158 |
+
|
| 159 |
+
# Distribution / packaging
|
| 160 |
+
.Python
|
| 161 |
+
build/
|
| 162 |
+
develop-eggs/
|
| 163 |
+
dist/
|
| 164 |
+
downloads/
|
| 165 |
+
eggs/
|
| 166 |
+
.eggs/
|
| 167 |
+
lib/
|
| 168 |
+
lib64/
|
| 169 |
+
parts/
|
| 170 |
+
sdist/
|
| 171 |
+
var/
|
| 172 |
+
wheels/
|
| 173 |
+
share/python-wheels/
|
| 174 |
+
*.egg-info/
|
| 175 |
+
.installed.cfg
|
| 176 |
+
*.egg
|
| 177 |
+
MANIFEST
|
| 178 |
+
|
| 179 |
+
# PyInstaller
|
| 180 |
+
# Usually these files are written by a python script from a template
|
| 181 |
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
| 182 |
+
*.manifest
|
| 183 |
+
*.spec
|
| 184 |
+
|
| 185 |
+
# Installer logs
|
| 186 |
+
pip-log.txt
|
| 187 |
+
pip-delete-this-directory.txt
|
| 188 |
+
|
| 189 |
+
# Unit test / coverage reports
|
| 190 |
+
htmlcov/
|
| 191 |
+
.tox/
|
| 192 |
+
.nox/
|
| 193 |
+
.coverage
|
| 194 |
+
.coverage.*
|
| 195 |
+
.cache
|
| 196 |
+
nosetests.xml
|
| 197 |
+
coverage.xml
|
| 198 |
+
*.cover
|
| 199 |
+
*.py,cover
|
| 200 |
+
.hypothesis/
|
| 201 |
+
.pytest_cache/
|
| 202 |
+
cover/
|
| 203 |
+
|
| 204 |
+
# Translations
|
| 205 |
+
*.mo
|
| 206 |
+
*.pot
|
| 207 |
+
|
| 208 |
+
# Django stuff:
|
| 209 |
+
*.log
|
| 210 |
+
local_settings.py
|
| 211 |
+
db.sqlite3
|
| 212 |
+
db.sqlite3-journal
|
| 213 |
+
|
| 214 |
+
# Flask stuff:
|
| 215 |
+
instance/
|
| 216 |
+
.webassets-cache
|
| 217 |
+
|
| 218 |
+
# Scrapy stuff:
|
| 219 |
+
.scrapy
|
| 220 |
+
|
| 221 |
+
# Sphinx documentation
|
| 222 |
+
docs/_build/
|
| 223 |
+
|
| 224 |
+
# PyBuilder
|
| 225 |
+
.pybuilder/
|
| 226 |
+
target/
|
| 227 |
+
|
| 228 |
+
# Jupyter Notebook
|
| 229 |
+
.ipynb_checkpoints
|
| 230 |
+
|
| 231 |
+
# IPython
|
| 232 |
+
profile_default/
|
| 233 |
+
ipython_config.py
|
| 234 |
+
|
| 235 |
+
# pyenv
|
| 236 |
+
# For a library or package, you might want to ignore these files since the code is
|
| 237 |
+
# intended to run in multiple environments; otherwise, check them in:
|
| 238 |
+
# .python-version
|
| 239 |
+
|
| 240 |
+
# pipenv
|
| 241 |
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
| 242 |
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
| 243 |
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
| 244 |
+
# install all needed dependencies.
|
| 245 |
+
#Pipfile.lock
|
| 246 |
+
|
| 247 |
+
# poetry
|
| 248 |
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
| 249 |
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
| 250 |
+
# commonly ignored for libraries.
|
| 251 |
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
| 252 |
+
#poetry.lock
|
| 253 |
+
|
| 254 |
+
# pdm
|
| 255 |
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
| 256 |
+
#pdm.lock
|
| 257 |
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
| 258 |
+
# in version control.
|
| 259 |
+
# https://pdm.fming.dev/#use-with-ide
|
| 260 |
+
.pdm.toml
|
| 261 |
+
|
| 262 |
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
| 263 |
+
__pypackages__/
|
| 264 |
+
|
| 265 |
+
# Celery stuff
|
| 266 |
+
celerybeat-schedule
|
| 267 |
+
celerybeat.pid
|
| 268 |
+
|
| 269 |
+
# SageMath parsed files
|
| 270 |
+
*.sage.py
|
| 271 |
+
|
| 272 |
+
# Environments
|
| 273 |
+
.env
|
| 274 |
+
.venv
|
| 275 |
+
env/
|
| 276 |
+
venv/
|
| 277 |
+
ENV/
|
| 278 |
+
env.bak/
|
| 279 |
+
venv.bak/
|
| 280 |
+
|
| 281 |
+
# Spyder project settings
|
| 282 |
+
.spyderproject
|
| 283 |
+
.spyproject
|
| 284 |
+
|
| 285 |
+
# Rope project settings
|
| 286 |
+
.ropeproject
|
| 287 |
+
|
| 288 |
+
# mkdocs documentation
|
| 289 |
+
/site
|
| 290 |
+
|
| 291 |
+
# mypy
|
| 292 |
+
.mypy_cache/
|
| 293 |
+
.dmypy.json
|
| 294 |
+
dmypy.json
|
| 295 |
+
|
| 296 |
+
# Pyre type checker
|
| 297 |
+
.pyre/
|
| 298 |
+
|
| 299 |
+
# pytype static type analyzer
|
| 300 |
+
.pytype/
|
| 301 |
+
|
| 302 |
+
# Cython debug symbols
|
| 303 |
+
cython_debug/
|
| 304 |
+
|
| 305 |
+
# PyCharm
|
| 306 |
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
| 307 |
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
| 308 |
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
| 309 |
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
| 310 |
+
#.idea/
|
| 311 |
+
|
| 312 |
+
### Python Patch ###
|
| 313 |
+
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
|
| 314 |
+
poetry.toml
|
| 315 |
+
|
| 316 |
+
docs/
|
| 317 |
+
|
| 318 |
+
|
| 319 |
+
# End of https://www.toptal.com/developers/gitignore/api/python
|
| 320 |
+
n
|
| 321 |
+
config.json
|
| 322 |
+
cache.json
|
| 323 |
+
config.yaml
|
| 324 |
+
.vscode
|
.env.example
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
OPENAI_API_KEY=""
|
| 2 |
+
MODEL="gpt-3.5-turbo"
|
| 3 |
+
CHAT_PRIVATE_TRIGGER_KEYWORD=
|
| 4 |
+
TEMPERATURE=
|
| 5 |
+
BLOCK_WORDS="VPN"
|
| 6 |
+
CHATGPT_BLOCK_WORDS="VPN"
|
| 7 |
+
WECHATY_PUPPET=wechaty-puppet-wechat
|
.gitignore
ADDED
|
@@ -0,0 +1,326 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Created by https://www.toptal.com/developers/gitignore/api/node
|
| 2 |
+
# Edit at https://www.toptal.com/developers/gitignore?templates=node
|
| 3 |
+
|
| 4 |
+
### Node ###
|
| 5 |
+
# Logs
|
| 6 |
+
logs
|
| 7 |
+
*.log
|
| 8 |
+
npm-debug.log*
|
| 9 |
+
yarn-debug.log*
|
| 10 |
+
yarn-error.log*
|
| 11 |
+
lerna-debug.log*
|
| 12 |
+
.pnpm-debug.log*
|
| 13 |
+
|
| 14 |
+
# Diagnostic reports (https://nodejs.org/api/report.html)
|
| 15 |
+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
| 16 |
+
|
| 17 |
+
# Runtime data
|
| 18 |
+
pids
|
| 19 |
+
*.pid
|
| 20 |
+
*.seed
|
| 21 |
+
*.pid.lock
|
| 22 |
+
|
| 23 |
+
# Directory for instrumented libs generated by jscoverage/JSCover
|
| 24 |
+
lib-cov
|
| 25 |
+
|
| 26 |
+
# Coverage directory used by tools like istanbul
|
| 27 |
+
coverage
|
| 28 |
+
*.lcov
|
| 29 |
+
|
| 30 |
+
# nyc test coverage
|
| 31 |
+
.nyc_output
|
| 32 |
+
|
| 33 |
+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
| 34 |
+
.grunt
|
| 35 |
+
|
| 36 |
+
# Bower dependency directory (https://bower.io/)
|
| 37 |
+
bower_components
|
| 38 |
+
|
| 39 |
+
# node-waf configuration
|
| 40 |
+
.lock-wscript
|
| 41 |
+
|
| 42 |
+
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
| 43 |
+
build/Release
|
| 44 |
+
|
| 45 |
+
# Dependency directories
|
| 46 |
+
node_modules/
|
| 47 |
+
jspm_packages/
|
| 48 |
+
|
| 49 |
+
# Snowpack dependency directory (https://snowpack.dev/)
|
| 50 |
+
web_modules/
|
| 51 |
+
|
| 52 |
+
# TypeScript cache
|
| 53 |
+
*.tsbuildinfo
|
| 54 |
+
|
| 55 |
+
# Optional npm cache directory
|
| 56 |
+
.npm
|
| 57 |
+
|
| 58 |
+
# Optional eslint cache
|
| 59 |
+
.eslintcache
|
| 60 |
+
|
| 61 |
+
# Optional stylelint cache
|
| 62 |
+
.stylelintcache
|
| 63 |
+
|
| 64 |
+
# Microbundle cache
|
| 65 |
+
.rpt2_cache/
|
| 66 |
+
.rts2_cache_cjs/
|
| 67 |
+
.rts2_cache_es/
|
| 68 |
+
.rts2_cache_umd/
|
| 69 |
+
|
| 70 |
+
# Optional REPL history
|
| 71 |
+
.node_repl_history
|
| 72 |
+
|
| 73 |
+
# Output of 'npm pack'
|
| 74 |
+
*.tgz
|
| 75 |
+
|
| 76 |
+
# Yarn Integrity file
|
| 77 |
+
.yarn-integrity
|
| 78 |
+
|
| 79 |
+
# dotenv environment variable files
|
| 80 |
+
.env
|
| 81 |
+
.env.development.local
|
| 82 |
+
.env.test.local
|
| 83 |
+
.env.production.local
|
| 84 |
+
.env.local
|
| 85 |
+
|
| 86 |
+
# parcel-bundler cache (https://parceljs.org/)
|
| 87 |
+
.cache
|
| 88 |
+
.parcel-cache
|
| 89 |
+
|
| 90 |
+
# Next.js build output
|
| 91 |
+
.next
|
| 92 |
+
out
|
| 93 |
+
|
| 94 |
+
# Nuxt.js build / generate output
|
| 95 |
+
.nuxt
|
| 96 |
+
dist
|
| 97 |
+
|
| 98 |
+
# Gatsby files
|
| 99 |
+
.cache/
|
| 100 |
+
# Comment in the public line in if your project uses Gatsby and not Next.js
|
| 101 |
+
# https://nextjs.org/blog/next-9-1#public-directory-support
|
| 102 |
+
# public
|
| 103 |
+
|
| 104 |
+
# vuepress build output
|
| 105 |
+
.vuepress/dist
|
| 106 |
+
|
| 107 |
+
# vuepress v2.x temp and cache directory
|
| 108 |
+
.temp
|
| 109 |
+
|
| 110 |
+
# Docusaurus cache and generated files
|
| 111 |
+
.docusaurus
|
| 112 |
+
|
| 113 |
+
# Serverless directories
|
| 114 |
+
.serverless/
|
| 115 |
+
|
| 116 |
+
# FuseBox cache
|
| 117 |
+
.fusebox/
|
| 118 |
+
|
| 119 |
+
# DynamoDB Local files
|
| 120 |
+
.dynamodb/
|
| 121 |
+
|
| 122 |
+
# TernJS port file
|
| 123 |
+
.tern-port
|
| 124 |
+
|
| 125 |
+
# Stores VSCode versions used for testing VSCode extensions
|
| 126 |
+
.vscode-test
|
| 127 |
+
|
| 128 |
+
# yarn v2
|
| 129 |
+
.yarn/cache
|
| 130 |
+
.yarn/unplugged
|
| 131 |
+
.yarn/build-state.yml
|
| 132 |
+
.yarn/install-state.gz
|
| 133 |
+
.pnp.*
|
| 134 |
+
|
| 135 |
+
### Node Patch ###
|
| 136 |
+
# Serverless Webpack directories
|
| 137 |
+
.webpack/
|
| 138 |
+
|
| 139 |
+
# Optional stylelint cache
|
| 140 |
+
|
| 141 |
+
# SvelteKit build / generate output
|
| 142 |
+
.svelte-kit
|
| 143 |
+
|
| 144 |
+
# End of https://www.toptal.com/developers/gitignore/api/node
|
| 145 |
+
n
|
| 146 |
+
*memory-card.json
|
| 147 |
+
# Created by https://www.toptal.com/developers/gitignore/api/python
|
| 148 |
+
# Edit at https://www.toptal.com/developers/gitignore?templates=python
|
| 149 |
+
|
| 150 |
+
### Python ###
|
| 151 |
+
# Byte-compiled / optimized / DLL files
|
| 152 |
+
__pycache__/
|
| 153 |
+
*.py[cod]
|
| 154 |
+
*$py.class
|
| 155 |
+
|
| 156 |
+
# C extensions
|
| 157 |
+
*.so
|
| 158 |
+
|
| 159 |
+
# Distribution / packaging
|
| 160 |
+
.Python
|
| 161 |
+
build/
|
| 162 |
+
develop-eggs/
|
| 163 |
+
dist/
|
| 164 |
+
downloads/
|
| 165 |
+
eggs/
|
| 166 |
+
.eggs/
|
| 167 |
+
lib/
|
| 168 |
+
lib64/
|
| 169 |
+
parts/
|
| 170 |
+
sdist/
|
| 171 |
+
var/
|
| 172 |
+
wheels/
|
| 173 |
+
share/python-wheels/
|
| 174 |
+
*.egg-info/
|
| 175 |
+
.installed.cfg
|
| 176 |
+
*.egg
|
| 177 |
+
MANIFEST
|
| 178 |
+
|
| 179 |
+
# PyInstaller
|
| 180 |
+
# Usually these files are written by a python script from a template
|
| 181 |
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
| 182 |
+
*.manifest
|
| 183 |
+
*.spec
|
| 184 |
+
|
| 185 |
+
# Installer logs
|
| 186 |
+
pip-log.txt
|
| 187 |
+
pip-delete-this-directory.txt
|
| 188 |
+
|
| 189 |
+
# Unit test / coverage reports
|
| 190 |
+
htmlcov/
|
| 191 |
+
.tox/
|
| 192 |
+
.nox/
|
| 193 |
+
.coverage
|
| 194 |
+
.coverage.*
|
| 195 |
+
.cache
|
| 196 |
+
nosetests.xml
|
| 197 |
+
coverage.xml
|
| 198 |
+
*.cover
|
| 199 |
+
*.py,cover
|
| 200 |
+
.hypothesis/
|
| 201 |
+
.pytest_cache/
|
| 202 |
+
cover/
|
| 203 |
+
|
| 204 |
+
# Translations
|
| 205 |
+
*.mo
|
| 206 |
+
*.pot
|
| 207 |
+
|
| 208 |
+
# Django stuff:
|
| 209 |
+
*.log
|
| 210 |
+
local_settings.py
|
| 211 |
+
db.sqlite3
|
| 212 |
+
db.sqlite3-journal
|
| 213 |
+
|
| 214 |
+
# Flask stuff:
|
| 215 |
+
instance/
|
| 216 |
+
.webassets-cache
|
| 217 |
+
|
| 218 |
+
# Scrapy stuff:
|
| 219 |
+
.scrapy
|
| 220 |
+
|
| 221 |
+
# Sphinx documentation
|
| 222 |
+
docs/_build/
|
| 223 |
+
|
| 224 |
+
# PyBuilder
|
| 225 |
+
.pybuilder/
|
| 226 |
+
target/
|
| 227 |
+
|
| 228 |
+
# Jupyter Notebook
|
| 229 |
+
.ipynb_checkpoints
|
| 230 |
+
|
| 231 |
+
# IPython
|
| 232 |
+
profile_default/
|
| 233 |
+
ipython_config.py
|
| 234 |
+
|
| 235 |
+
# pyenv
|
| 236 |
+
# For a library or package, you might want to ignore these files since the code is
|
| 237 |
+
# intended to run in multiple environments; otherwise, check them in:
|
| 238 |
+
# .python-version
|
| 239 |
+
|
| 240 |
+
# pipenv
|
| 241 |
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
| 242 |
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
| 243 |
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
| 244 |
+
# install all needed dependencies.
|
| 245 |
+
#Pipfile.lock
|
| 246 |
+
|
| 247 |
+
# poetry
|
| 248 |
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
| 249 |
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
| 250 |
+
# commonly ignored for libraries.
|
| 251 |
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
| 252 |
+
#poetry.lock
|
| 253 |
+
|
| 254 |
+
# pdm
|
| 255 |
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
| 256 |
+
#pdm.lock
|
| 257 |
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
| 258 |
+
# in version control.
|
| 259 |
+
# https://pdm.fming.dev/#use-with-ide
|
| 260 |
+
.pdm.toml
|
| 261 |
+
|
| 262 |
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
| 263 |
+
__pypackages__/
|
| 264 |
+
|
| 265 |
+
# Celery stuff
|
| 266 |
+
celerybeat-schedule
|
| 267 |
+
celerybeat.pid
|
| 268 |
+
|
| 269 |
+
# SageMath parsed files
|
| 270 |
+
*.sage.py
|
| 271 |
+
|
| 272 |
+
# Environments
|
| 273 |
+
.env
|
| 274 |
+
.venv
|
| 275 |
+
env/
|
| 276 |
+
venv/
|
| 277 |
+
ENV/
|
| 278 |
+
env.bak/
|
| 279 |
+
venv.bak/
|
| 280 |
+
|
| 281 |
+
# Spyder project settings
|
| 282 |
+
.spyderproject
|
| 283 |
+
.spyproject
|
| 284 |
+
|
| 285 |
+
# Rope project settings
|
| 286 |
+
.ropeproject
|
| 287 |
+
|
| 288 |
+
# mkdocs documentation
|
| 289 |
+
/site
|
| 290 |
+
|
| 291 |
+
# mypy
|
| 292 |
+
.mypy_cache/
|
| 293 |
+
.dmypy.json
|
| 294 |
+
dmypy.json
|
| 295 |
+
|
| 296 |
+
# Pyre type checker
|
| 297 |
+
.pyre/
|
| 298 |
+
|
| 299 |
+
# pytype static type analyzer
|
| 300 |
+
.pytype/
|
| 301 |
+
|
| 302 |
+
# Cython debug symbols
|
| 303 |
+
cython_debug/
|
| 304 |
+
|
| 305 |
+
# PyCharm
|
| 306 |
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
| 307 |
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
| 308 |
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
| 309 |
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
| 310 |
+
.idea/
|
| 311 |
+
|
| 312 |
+
### Python Patch ###
|
| 313 |
+
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
|
| 314 |
+
poetry.toml
|
| 315 |
+
|
| 316 |
+
|
| 317 |
+
# End of https://www.toptal.com/developers/gitignore/api/python
|
| 318 |
+
n
|
| 319 |
+
config.json
|
| 320 |
+
cache.json
|
| 321 |
+
config.yaml
|
| 322 |
+
.vscode
|
| 323 |
+
|
| 324 |
+
data/
|
| 325 |
+
|
| 326 |
+
public/
|
Dockerfile
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM node:19 AS app
|
| 2 |
+
|
| 3 |
+
# We don't need the standalone Chromium
|
| 4 |
+
RUN apt-get install -y wget \
|
| 5 |
+
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
|
| 6 |
+
&& echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list \
|
| 7 |
+
&& apt-get update && apt-get -y install google-chrome-stable chromium xvfb\
|
| 8 |
+
&& rm -rf /var/lib/apt/lists/* \
|
| 9 |
+
&& echo "Chrome: " && google-chrome --version
|
| 10 |
+
WORKDIR /app
|
| 11 |
+
COPY package*.json ./
|
| 12 |
+
RUN npm install
|
| 13 |
+
COPY . .
|
| 14 |
+
CMD xvfb-run --server-args="-screen 0 1280x800x24 -ac -nolisten tcp -dpi 96 +extension RANDR" npm run dev
|
README.md
CHANGED
|
@@ -1,3 +1,191 @@
|
|
| 1 |
-
-
|
| 2 |
-
|
| 3 |
-
--
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<h1 align="center">Welcome to wechat-chatgpt 👋</h1>
|
| 2 |
+
<p>
|
| 3 |
+
<img alt="Version" src="https://img.shields.io/badge/version-1.0.0-blue.svg?cacheSeconds=2592000" />
|
| 4 |
+
<a href="#" target="_blank">
|
| 5 |
+
<img alt="License: ISC" src="https://img.shields.io/badge/License-ISC-yellow.svg" />
|
| 6 |
+
</a>
|
| 7 |
+
<a href="https://twitter.com/fuergaosi" target="_blank">
|
| 8 |
+
<img alt="Twitter: fuergaosi" src="https://img.shields.io/twitter/follow/fuergaosi.svg?style=social" />
|
| 9 |
+
</a>
|
| 10 |
+
</a>
|
| 11 |
+
<a href="https://discord.gg/8fXNrxwUJH" target="blank">
|
| 12 |
+
<img src="https://img.shields.io/discord/1058994816446369832?label=Join%20Community&logo=discord&style=flat-square" alt="join discord community of github profile readme generator"/>
|
| 13 |
+
</a>
|
| 14 |
+
</p>
|
| 15 |
+
|
| 16 |
+
> Use ChatGPT On Wechat via wechaty
|
| 17 |
+
> English | [中文文档](README_ZH.md)
|
| 18 |
+
|
| 19 |
+
[](https://railway.app/template/dMLG70?referralCode=bIYugQ)
|
| 20 |
+
|
| 21 |
+
## 🌟 Features
|
| 22 |
+
|
| 23 |
+
- Interact with WeChat and ChatGPT:
|
| 24 |
+
- Use ChatGPT on WeChat with [wechaty](https://github.com/wechaty/wechaty) and [Official API](https://openai.com/blog/introducing-chatgpt-and-whisper-apis)
|
| 25 |
+
- Add conversation support
|
| 26 |
+
- Support command setting
|
| 27 |
+
|
| 28 |
+
- Deployment and configuration options:
|
| 29 |
+
- Add Dockerfile, deployable with [docker](#use-with-docker)
|
| 30 |
+
- Support deployment using [docker compose](#use-with-docker-compose)
|
| 31 |
+
- Support [Railway](#use-with-railway) and [Fly.io](#use-with-flyio) deployment
|
| 32 |
+
|
| 33 |
+
- Other features:
|
| 34 |
+
- Support [Dall·E](https://labs.openai.com/)
|
| 35 |
+
- Support [whisper](https://openai.com/blog/introducing-chatgpt-and-whisper-apis)
|
| 36 |
+
- Support setting prompt
|
| 37 |
+
- Support proxy (in development)
|
| 38 |
+
|
| 39 |
+
## 🚀 Usage
|
| 40 |
+
- [Use with Railway](#use-with-railway)(PaaS, Free, Stable, ✅Recommended)
|
| 41 |
+
- [Use with Fly.io](#use-with-flyio)(Paas, Free, ✅Recommended)
|
| 42 |
+
- [Use with docker](#use-with-docker)(Self-hosted, Stable, ✅Recommended)
|
| 43 |
+
- [Use with docker compose](#use-with-docker-compose)(Self-hosted, Stable, ✅Recommended)
|
| 44 |
+
- [Use with nodejs](#use-with-nodejs)(Self-hosted)
|
| 45 |
+
|
| 46 |
+
## Use with Railway
|
| 47 |
+
> Railway offers $5 or 500 hours of runtime per month
|
| 48 |
+
1. Click the [Railway](https://railway.app/template/dMLG70?referralCode=bIYugQ) button to go to the Railway deployment page
|
| 49 |
+
2. Click the `Deploy Now` button to enter the Railway deployment page
|
| 50 |
+
3. Fill in the repository name and `OPENAI_API_KEY` (need to link GitHub account)
|
| 51 |
+
4. Click the `Deploy` button
|
| 52 |
+
5. Click the `View Logs` button and wait for the deployment to complete
|
| 53 |
+
|
| 54 |
+
## Use with Fly.io
|
| 55 |
+
> Please allocate 512MB memory for the application to meet the application requirements
|
| 56 |
+
|
| 57 |
+
> fly.io offers free bills up to $5(Free Allowances 3 256MB are not included in the bill)
|
| 58 |
+
1. Install [flyctl](https://fly.io/docs/getting-started/installing-flyctl/)
|
| 59 |
+
```shell
|
| 60 |
+
# macOS
|
| 61 |
+
brew install flyctl
|
| 62 |
+
# Windows
|
| 63 |
+
scoop install flyctl
|
| 64 |
+
# Linux
|
| 65 |
+
curl https://fly.io/install.sh | sh
|
| 66 |
+
```
|
| 67 |
+
2. Clone the project and enter the project directory
|
| 68 |
+
```shell
|
| 69 |
+
git clone https://github.com/fuergaosi233/wechat-chatgpt.git && cd wechat-chatgpt
|
| 70 |
+
```
|
| 71 |
+
3. Create a new app
|
| 72 |
+
```shell
|
| 73 |
+
➜ flyctl launch
|
| 74 |
+
? Would you like to copy its configuration to the new app? No
|
| 75 |
+
? App Name (leave blank to use an auto-generated name): <YOUR APP NAME>
|
| 76 |
+
? Select region: <YOUR CHOOSE REGION>
|
| 77 |
+
? Would you like to setup a Postgresql database now? No
|
| 78 |
+
? Would you like to deploy now? No
|
| 79 |
+
```
|
| 80 |
+
4. Configure the environment variables
|
| 81 |
+
```shell
|
| 82 |
+
flyctl secrets set OPENAI_API_KEY="<YOUR OPENAI API KEY>" MODEL="<CHATGPT-MODEL>"
|
| 83 |
+
```
|
| 84 |
+
5. Deploy the app
|
| 85 |
+
```shell
|
| 86 |
+
flyctl deploy
|
| 87 |
+
```
|
| 88 |
+
|
| 89 |
+
## Use with docker
|
| 90 |
+
|
| 91 |
+
```sh
|
| 92 |
+
# pull image
|
| 93 |
+
docker pull holegots/wechat-chatgpt
|
| 94 |
+
# run container
|
| 95 |
+
docker run -d --name wechat-chatgpt \
|
| 96 |
+
-e OPENAI_API_KEY=<YOUR OPENAI API KEY> \
|
| 97 |
+
-e MODEL="gpt-3.5-turbo" \
|
| 98 |
+
-e CHAT_PRIVATE_TRIGGER_KEYWORD="" \
|
| 99 |
+
-v $(pwd)/data:/app/data/wechat-assistant.memory-card.json \
|
| 100 |
+
holegots/wechat-chatgpt:latest
|
| 101 |
+
# View the QR code to log in to wechat
|
| 102 |
+
docker logs -f wechat-chatgpt
|
| 103 |
+
```
|
| 104 |
+
> How to get OPENAI API KEY? [Click here](https://platform.openai.com/account/api-keys)
|
| 105 |
+
|
| 106 |
+
## Use with docker compose
|
| 107 |
+
|
| 108 |
+
```sh
|
| 109 |
+
# Copy the configuration file according to the template
|
| 110 |
+
cp .env.example .env
|
| 111 |
+
# Edit the configuration file
|
| 112 |
+
vim .env
|
| 113 |
+
# Start the container
|
| 114 |
+
docker-compose up -d
|
| 115 |
+
# View the QR code to log in to wechat
|
| 116 |
+
docker logs -f wechat-chatgpt
|
| 117 |
+
```
|
| 118 |
+
|
| 119 |
+
## Use with nodejs
|
| 120 |
+
|
| 121 |
+
> You need NodeJS 18.0.0 version and above
|
| 122 |
+
|
| 123 |
+
```sh
|
| 124 |
+
# Clone the project
|
| 125 |
+
git clone https://github.com/fuergaosi233/wechat-chatgpt.git && cd wechat-chatgpt
|
| 126 |
+
# Install dependencies
|
| 127 |
+
npm install
|
| 128 |
+
# Copy the configuration file according to the template
|
| 129 |
+
cp .env.example .env
|
| 130 |
+
# Edit the configuration file
|
| 131 |
+
vim .env
|
| 132 |
+
# Start project
|
| 133 |
+
npm run dev
|
| 134 |
+
```
|
| 135 |
+
|
| 136 |
+
> Please make sure your WeChat account can log in [WeChat on web](https://wx.qq.com/)
|
| 137 |
+
|
| 138 |
+
## 📝 Environment Variables
|
| 139 |
+
|
| 140 |
+
| name | default | example | description |
|
| 141 |
+
|------------------------------|------------------------|------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
| 142 |
+
| ~~API~~ | https://api.openai.com | | ~~API endpoint of ChatGPT~~ |
|
| 143 |
+
| OPENAI_API_KEY | 123456789 | sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | [create new secret key](https://platform.openai.com/account/api-keys) |
|
| 144 |
+
| MODEL | gpt-3.5-turbo | | ID of the model to use. Currently, only gpt-3.5-turbo and gpt-3.5-turbo-0301 are supported. |
|
| 145 |
+
| TEMPERATURE | 0.6 | | What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. |
|
| 146 |
+
| CHAT_TRIGGER_RULE | | | Private chat triggering rules. |
|
| 147 |
+
| DISABLE_GROUP_MESSAGE | true | | Prohibited to use ChatGPT in group chat. |
|
| 148 |
+
| CHAT_PRIVATE_TRIGGER_KEYWORD | | | Keyword to trigger ChatGPT reply in WeChat private chat |
|
| 149 |
+
| BLOCK_WORDS | "VPN" | "WORD1,WORD2,WORD3" | Chat blocker words, (works for both private and group chats, Use, Split) |
|
| 150 |
+
| CHATGPT_BLOCK_WORDS | "VPN" | "WORD1,WORD2,WORD3" | The blocked words returned by ChatGPT(works for both private and group chats, Use, Split) |
|
| 151 |
+
|
| 152 |
+
## 📝 Using Custom ChatGPT API
|
| 153 |
+
|
| 154 |
+
> https://github.com/fuergaosi233/openai-proxy
|
| 155 |
+
|
| 156 |
+
```shell
|
| 157 |
+
# Clone the project
|
| 158 |
+
git clone https://github.com/fuergaosi233/openai-proxy
|
| 159 |
+
# Install dependencies
|
| 160 |
+
npm install && npm install -g wrangler && npm run build
|
| 161 |
+
# Deploy to CloudFlare Workers
|
| 162 |
+
npm run deploy
|
| 163 |
+
# Custom domain (optional)
|
| 164 |
+
Add `Route` to `wrangler.toml`
|
| 165 |
+
routes = [
|
| 166 |
+
{ pattern = "Your Custom Domain", custom_domain = true },
|
| 167 |
+
]
|
| 168 |
+
```
|
| 169 |
+
|
| 170 |
+
## ⌨️ Commands
|
| 171 |
+
> Enter in the WeChat chat box
|
| 172 |
+
```shell
|
| 173 |
+
/cmd help # Show help
|
| 174 |
+
/cmd prompt <PROMPT> # Set prompt
|
| 175 |
+
/cmd clear # Clear all sessions since last boot
|
| 176 |
+
```
|
| 177 |
+
|
| 178 |
+
## ✨ Contributor
|
| 179 |
+
|
| 180 |
+
<a href="https://github.com/fuergaosi233/wechat-chatgpt/graphs/contributors">
|
| 181 |
+
<img src="https://contrib.rocks/image?repo=fuergaosi233/wechat-chatgpt" />
|
| 182 |
+
</a>
|
| 183 |
+
|
| 184 |
+
## 🤝 Contributing
|
| 185 |
+
|
| 186 |
+
Contributions, issues and feature requests are welcome!<br />Feel free to
|
| 187 |
+
check [issues page](https://github.com/fuergaosi233/wechat-chatgpt/issues).
|
| 188 |
+
|
| 189 |
+
## Show your support
|
| 190 |
+
|
| 191 |
+
Give a ⭐️ if this project helped you!
|
README_ZH.md
ADDED
|
@@ -0,0 +1,194 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<h1 align="center">欢迎使用 wechat-chatgpt 👋</h1>
|
| 2 |
+
<p>
|
| 3 |
+
<img alt="Version" src="https://img.shields.io/badge/version-1.0.0-blue.svg?cacheSeconds=2592000" />
|
| 4 |
+
<a href="#" target="_blank">
|
| 5 |
+
<img alt="License: ISC" src="https://img.shields.io/badge/License-ISC-yellow.svg" />
|
| 6 |
+
</a>
|
| 7 |
+
<a href="https://twitter.com/fuergaosi" target="_blank">
|
| 8 |
+
<img alt="Twitter: fuergaosi" src="https://img.shields.io/twitter/follow/fuergaosi.svg?style=social" />
|
| 9 |
+
</a>
|
| 10 |
+
<a href="https://discord.gg/8fXNrxwUJH" target="blank">
|
| 11 |
+
<img src="https://img.shields.io/discord/1058994816446369832?label=Join%20Community&logo=discord&style=flat-square" alt="join discord community of github profile readme generator"/>
|
| 12 |
+
</a>
|
| 13 |
+
</p>
|
| 14 |
+
|
| 15 |
+
> 在微信上迅速接入 ChatGPT,让它成为你最好的助手!
|
| 16 |
+
> [English](README.md) | 中文文档
|
| 17 |
+
|
| 18 |
+
[](https://railway.app/template/dMLG70?referralCode=bIYugQ)
|
| 19 |
+
|
| 20 |
+
## 🌟 功能点
|
| 21 |
+
|
| 22 |
+
- 使用 WeChat 和 ChatGPT 进行互动:
|
| 23 |
+
- 基于 [wechaty](https://github.com/wechaty/wechaty) 和 [Official API](https://openai.com/blog/introducing-chatgpt-and-whisper-apis) 在微信中使用 ChatGPT
|
| 24 |
+
- 支持多轮对话
|
| 25 |
+
- 支持[命令](#-命令)设置
|
| 26 |
+
|
| 27 |
+
- 部署和配置选项:
|
| 28 |
+
- 提供 Dockerfile,可以通过 [docker](#通过docker使用) 进行部署
|
| 29 |
+
- 支持使用 [docker compose](#通过docker-compose使用) 进行部署
|
| 30 |
+
- 支持在 [Railway](#使用railway进行部署) 和 [Fly.io](#通过flyio进行部署) 上部署
|
| 31 |
+
|
| 32 |
+
- 其他功能:
|
| 33 |
+
- 支持 [Dall·E](https://labs.openai.com/)
|
| 34 |
+
- 支持 [whisper](https://openai.com/blog/introducing-chatgpt-and-whisper-apis)
|
| 35 |
+
- 支持设置 prompt
|
| 36 |
+
- 支持代理(开发中)
|
| 37 |
+
|
| 38 |
+
## 🚀 使用
|
| 39 |
+
|
| 40 |
+
- [在 Railway 部署](#使用railway进行部署)(PaaS, 免费, 稳定, ✅推荐)
|
| 41 |
+
- [在 Fly.io 部署](#通过flyio进行部署)(PaaS, 免费, ✅推荐)
|
| 42 |
+
- [使用 Docker 部署](#通过docker使用)(自托管, 稳定, ✅推荐)
|
| 43 |
+
- [使用 Docker Compose 部署](#通过docker-compose使用)(自托管, 稳定, ✅推荐)
|
| 44 |
+
- [使用 NodeJS 部署](#使用nodejs运行)
|
| 45 |
+
|
| 46 |
+
## 使用Railway进行部署
|
| 47 |
+
|
| 48 |
+
> Railway 是一个免费的 PaaS 平台,5刀以内的账单免费或者每个月500小时的运行时间
|
| 49 |
+
|
| 50 |
+
1. 点击 [Railway](https://railway.app/template/dMLG70?referralCode=bIYugQ) 按钮,进入 Railway 部署页面
|
| 51 |
+
2. 点击 `Deploy Now` 按钮,进入 Railway 部署页面
|
| 52 |
+
3. 填写 仓库名称和 `OPENAI_API_KEY`(需要连接 GitHub 账号)
|
| 53 |
+
4. 点击 `Deploy` 按钮
|
| 54 |
+
5. 点击 `View Logs` 按钮,等待部署完成
|
| 55 |
+
|
| 56 |
+
## 通过Fly.io进行部署
|
| 57 |
+
|
| 58 |
+
> 请为应用程序分配 512 MB 内存,否则可能会出现内存溢出
|
| 59 |
+
|
| 60 |
+
> Fly.io 5刀以内的账单免费(免费计划的3个256MB的应用不在账单内)也就是可以同时可以部署 `1*512MB + 3*256MB`
|
| 61 |
+
|
| 62 |
+
1. 安装 [flyctl](https://fly.io/docs/getting-started/installing-flyctl/)
|
| 63 |
+
```shell
|
| 64 |
+
# macOS
|
| 65 |
+
brew install flyctl
|
| 66 |
+
# Windows
|
| 67 |
+
scoop install flyctl
|
| 68 |
+
# Linux
|
| 69 |
+
curl https://fly.io/install.sh | sh
|
| 70 |
+
```
|
| 71 |
+
2. 克隆项目并进入项目目录
|
| 72 |
+
```shell
|
| 73 |
+
git clone https://github.com/fuergaosi233/wechat-chatgpt.git && cd wechat-chatgpt
|
| 74 |
+
```
|
| 75 |
+
3. 创建应用
|
| 76 |
+
```shell
|
| 77 |
+
➜ flyctl launch
|
| 78 |
+
? Would you like to copy its configuration to the new app? No
|
| 79 |
+
? App Name (leave blank to use an auto-generated name): <YOUR APP NAME>
|
| 80 |
+
? Select region: <YOUR CHOOSE REGION>
|
| 81 |
+
? Would you like to setup a Postgresql database now? No
|
| 82 |
+
? Would you like to deploy now? No
|
| 83 |
+
```
|
| 84 |
+
4. 配置环境变量
|
| 85 |
+
```shell
|
| 86 |
+
flyctl secrets set OPENAI_API_KEY="<YOUR OPENAI API KEY>" MODEL="<CHATGPT-MODEL>"
|
| 87 |
+
```
|
| 88 |
+
5. 部署应用
|
| 89 |
+
```shell
|
| 90 |
+
flyctl deploy
|
| 91 |
+
```
|
| 92 |
+
|
| 93 |
+
## 通过Docker使用
|
| 94 |
+
|
| 95 |
+
```sh
|
| 96 |
+
# 拉取镜像
|
| 97 |
+
docker pull holegots/wechat-chatgpt:latest
|
| 98 |
+
# 运行容器
|
| 99 |
+
docker run -it --name wechat-chatgpt \
|
| 100 |
+
-e OPENAI_API_KEY=<YOUR OPENAI API KEY> \
|
| 101 |
+
-e MODEL="gpt-3.5-turbo" \
|
| 102 |
+
-e CHAT_PRIVATE_TRIGGER_KEYWORD="" \
|
| 103 |
+
-v $(pwd)/data:/app/data/wechat-assistant.memory-card.json \
|
| 104 |
+
holegots/wechat-chatgpt:latest
|
| 105 |
+
# 使用二维码登陆
|
| 106 |
+
docker logs -f wechat-chatgpt
|
| 107 |
+
```
|
| 108 |
+
|
| 109 |
+
> 如何获取 OPENAI API KEY?请参考 [OpenAI API](https://platform.openai.com/account/api-keys)。
|
| 110 |
+
|
| 111 |
+
## 通过docker compose使用
|
| 112 |
+
|
| 113 |
+
```sh
|
| 114 |
+
# 根据模板拷贝配置文件
|
| 115 |
+
cp .env.example .env
|
| 116 |
+
# 使用你喜欢的文本编辑器修改配置文件
|
| 117 |
+
vim .env
|
| 118 |
+
# 在Linux或WindowsPowerShell上运行如下命令
|
| 119 |
+
docker compose up -d
|
| 120 |
+
# 使用二维码登陆
|
| 121 |
+
docker logs -f wechat-chatgpt
|
| 122 |
+
```
|
| 123 |
+
|
| 124 |
+
## 使用NodeJS运行
|
| 125 |
+
|
| 126 |
+
> 请确认安装的NodeJS版本为18.0.0以上
|
| 127 |
+
|
| 128 |
+
```sh
|
| 129 |
+
# 克隆项目
|
| 130 |
+
git clone https://github.com/fuergaosi233/wechat-chatgpt.git && cd wechat-chatgpt
|
| 131 |
+
# 安装依赖
|
| 132 |
+
npm install
|
| 133 |
+
# 编辑配置
|
| 134 |
+
cp .env.example .env
|
| 135 |
+
vim .env # 使用你喜欢的文本编辑器修改配置文件
|
| 136 |
+
# 启动项目
|
| 137 |
+
npm run dev
|
| 138 |
+
# 如果您是初次登陆,那么需要扫描二维码
|
| 139 |
+
```
|
| 140 |
+
|
| 141 |
+
> 请确保您的账号可以登陆 [网页版微信](https://wx.qq.com/)。
|
| 142 |
+
|
| 143 |
+
## 📝 Environment Variables
|
| 144 |
+
|
| 145 |
+
| name | default | example | description |
|
| 146 |
+
|------------------------------|------------------------|------------------------------------------------|-------------------------------------------------------------|
|
| 147 |
+
| ~~API~~ | https://api.openai.com | | ~~ChatGPT API 地址~~ |
|
| 148 |
+
| OPENAI_API_KEY | 123456789 | sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | [创建你的 API 密钥](https://platform.openai.com/account/api-keys) |
|
| 149 |
+
| MODEL | gpt-3.5-turbo | | 要使用的模型ID, 目前仅支持`gpt-3.5-turbo` 和 `gpt-3.5-turbo-0301` |
|
| 150 |
+
| TEMPERATURE | 0.6 | | 在0和2之间。较高的数值如0.8会使 ChatGPT 输出更加随机,而较低的数值如0.2会使其更加稳定。 |
|
| 151 |
+
| CHAT_TRIGGER_RULE | | | 私聊触发规则 |
|
| 152 |
+
| DISABLE_GROUP_MESSAGE | true | | 禁用在群聊里使用ChatGPT |
|
| 153 |
+
| CHAT_PRIVATE_TRIGGER_KEYWORD | | | 在私聊中触发ChatGPT的关键词, 默认是无需关键词即可触发 |
|
| 154 |
+
| BLOCK_WORDS | "VPN" | "WORD1,WORD2,WORD3" | 聊天屏蔽关键词(同时在群组和私聊中生效, 避免 bot 用户恶意提问导致封号 |
|
| 155 |
+
| CHATGPT_BLOCK_WORDS | "VPN" | "WORD1,WORD2,WORD3" | ChatGPT回复屏蔽词, 如果ChatGPT的回复中包含了屏蔽词, 则不回复 |
|
| 156 |
+
|
| 157 |
+
## 📝 使用自定义ChatGPT API
|
| 158 |
+
> https://github.com/fuergaosi233/openai-proxy
|
| 159 |
+
```shell
|
| 160 |
+
# 克隆项目
|
| 161 |
+
git clone https://github.com/fuergaosi233/openai-proxy
|
| 162 |
+
# 安装依赖
|
| 163 |
+
npm install && npm install -g wrangler && npm run build
|
| 164 |
+
# 部署到 CloudFlare Workers
|
| 165 |
+
npm run deploy
|
| 166 |
+
# 自定义域名(可选)
|
| 167 |
+
添加 `Route`` 到 `wrangler.toml`
|
| 168 |
+
routes = [
|
| 169 |
+
{ pattern = "Your Custom Domain", custom_domain = true },
|
| 170 |
+
]
|
| 171 |
+
```
|
| 172 |
+
|
| 173 |
+
## ⌨️ 命令
|
| 174 |
+
> 在微信聊天框中输入
|
| 175 |
+
```shell
|
| 176 |
+
/cmd help # 显示帮助信息
|
| 177 |
+
/cmd prompt <PROMPT> # 设置ChatGPT Prompt
|
| 178 |
+
/cmd clear # 清除WeChat-ChatGPT保存的会话记录
|
| 179 |
+
```
|
| 180 |
+
|
| 181 |
+
## ✨ Contributor
|
| 182 |
+
|
| 183 |
+
<a href="https://github.com/fuergaosi233/wechat-chatgpt/graphs/contributors">
|
| 184 |
+
<img src="https://contrib.rocks/image?repo=fuergaosi233/wechat-chatgpt" />
|
| 185 |
+
</a>
|
| 186 |
+
|
| 187 |
+
## 🤝 为项目添砖加瓦
|
| 188 |
+
|
| 189 |
+
欢迎提出 Contributions, issues 与 feature requests!<br />
|
| 190 |
+
随时查看 [issues page](https://github.com/fuergaosi233/wechat-chatgpt/issues).
|
| 191 |
+
|
| 192 |
+
## 感谢支持 🙏
|
| 193 |
+
|
| 194 |
+
如果这个项目对你产生了一点的帮助,请为这个项目点上一颗 ⭐️
|
docker-compose.yml
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version: '3'
|
| 2 |
+
services:
|
| 3 |
+
wechat-chatgpt:
|
| 4 |
+
image: wechat-chatgpt
|
| 5 |
+
build: .
|
| 6 |
+
volumes:
|
| 7 |
+
- ./data/wechat-assistant.memory-card.json:/app/wechat-assistant.memory-card.json
|
| 8 |
+
env_file:
|
| 9 |
+
- .env
|
package-lock.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "wechat-chatgpt",
|
| 3 |
+
"version": "1.0.0",
|
| 4 |
+
"description": "",
|
| 5 |
+
"main": "dist/main.js",
|
| 6 |
+
"export": "dist/main.js",
|
| 7 |
+
"scripts": {
|
| 8 |
+
"dev": "nodemon --exec node --loader ts-node/esm src/main.ts",
|
| 9 |
+
"build": "tsc"
|
| 10 |
+
},
|
| 11 |
+
"author": "",
|
| 12 |
+
"license": "ISC",
|
| 13 |
+
"dependencies": {
|
| 14 |
+
"async-retry": "^1.3.3",
|
| 15 |
+
"dotenv": "^16.0.3",
|
| 16 |
+
"execa": "^6.1.0",
|
| 17 |
+
"openai": "^3.2.1",
|
| 18 |
+
"qrcode": "^1.5.1",
|
| 19 |
+
"uuid": "^9.0.0",
|
| 20 |
+
"wechaty": "^1.20.2",
|
| 21 |
+
"wechaty-puppet-wechat": "^1.18.4"
|
| 22 |
+
},
|
| 23 |
+
"devDependencies": {
|
| 24 |
+
"@types/async-retry": "^1.4.5",
|
| 25 |
+
"@types/qrcode": "^1.5.0",
|
| 26 |
+
"@types/uuid": "^9.0.0",
|
| 27 |
+
"nodemon": "^2.0.20",
|
| 28 |
+
"ts-node": "^10.9.1"
|
| 29 |
+
},
|
| 30 |
+
"nodemonConfig": {
|
| 31 |
+
"watch": [
|
| 32 |
+
"src/*.ts"
|
| 33 |
+
],
|
| 34 |
+
"ignore": [
|
| 35 |
+
"src/main.ts"
|
| 36 |
+
],
|
| 37 |
+
"ext": "ts",
|
| 38 |
+
"exec": "node --loader ts-node/esm src/main.ts",
|
| 39 |
+
"delay": 500
|
| 40 |
+
},
|
| 41 |
+
"type": "module"
|
| 42 |
+
}
|
tsconfig.json
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"compilerOptions": {
|
| 3 |
+
/* Visit https://aka.ms/tsconfig.json to read more about this file */
|
| 4 |
+
|
| 5 |
+
/* Projects */
|
| 6 |
+
// "incremental": true, /* Enable incremental compilation */
|
| 7 |
+
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
| 8 |
+
// "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */
|
| 9 |
+
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */
|
| 10 |
+
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
| 11 |
+
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
| 12 |
+
|
| 13 |
+
/* Language and Environment */
|
| 14 |
+
"target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
| 15 |
+
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
| 16 |
+
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
| 17 |
+
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
|
| 18 |
+
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
| 19 |
+
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */
|
| 20 |
+
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
| 21 |
+
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */
|
| 22 |
+
// "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */
|
| 23 |
+
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
| 24 |
+
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
| 25 |
+
|
| 26 |
+
/* Modules */
|
| 27 |
+
"module": "esnext", /* Specify what module code is generated. */
|
| 28 |
+
"rootDir": "src", /* Specify the root folder within your source files. */
|
| 29 |
+
"moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
|
| 30 |
+
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
| 31 |
+
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
| 32 |
+
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
| 33 |
+
// "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */
|
| 34 |
+
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
| 35 |
+
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
| 36 |
+
"resolveJsonModule": true, /* Enable importing .json files */
|
| 37 |
+
// "noResolve": true, /* Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project. */
|
| 38 |
+
|
| 39 |
+
/* JavaScript Support */
|
| 40 |
+
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */
|
| 41 |
+
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
| 42 |
+
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */
|
| 43 |
+
|
| 44 |
+
/* Emit */
|
| 45 |
+
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
| 46 |
+
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
| 47 |
+
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
| 48 |
+
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
| 49 |
+
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
|
| 50 |
+
"outDir": "dist", /* Specify an output folder for all emitted files. */
|
| 51 |
+
// "removeComments": true, /* Disable emitting comments. */
|
| 52 |
+
// "noEmit": true, /* Disable emitting files from a compilation. */
|
| 53 |
+
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
| 54 |
+
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
|
| 55 |
+
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
| 56 |
+
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
| 57 |
+
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
| 58 |
+
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
| 59 |
+
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
| 60 |
+
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
| 61 |
+
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
| 62 |
+
// "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */
|
| 63 |
+
// "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */
|
| 64 |
+
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
| 65 |
+
// "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */
|
| 66 |
+
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
| 67 |
+
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
|
| 68 |
+
|
| 69 |
+
/* Interop Constraints */
|
| 70 |
+
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
| 71 |
+
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
| 72 |
+
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */
|
| 73 |
+
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
| 74 |
+
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
|
| 75 |
+
|
| 76 |
+
/* Type Checking */
|
| 77 |
+
"strict": true, /* Enable all strict type-checking options. */
|
| 78 |
+
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */
|
| 79 |
+
// "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */
|
| 80 |
+
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
| 81 |
+
// "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */
|
| 82 |
+
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
| 83 |
+
// "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */
|
| 84 |
+
// "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */
|
| 85 |
+
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
| 86 |
+
// "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */
|
| 87 |
+
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */
|
| 88 |
+
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
| 89 |
+
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
| 90 |
+
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
| 91 |
+
// "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
|
| 92 |
+
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
| 93 |
+
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */
|
| 94 |
+
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
| 95 |
+
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
| 96 |
+
|
| 97 |
+
/* Completeness */
|
| 98 |
+
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
| 99 |
+
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
| 100 |
+
}
|
| 101 |
+
}
|