Yet another telegram ChatGPT bot which allows you to setup and run your bot with one simple command. PRs and suggestions are welcome. Leave a 🌟 if you find this project helpful.
⚠️ Warning: The underlying model is currentlygpt-3.5-turbo
, which is already fine-tuned for conversation but costs money. A new OpenAI account comes with $18 free credit though, which is enough to run this bot for some time.
Support for using a reverse proxy to access the origin ChatGPT will be added soon.
It.s.working.mp4
- Run your ChatGPT telegram bot with single command.
- Support group chat by metioning
@
bot whilebot privacy mode
turned off. - Reload conversion with
/reload
command. - Support group chat with
/chat
command whilebot privacy mode
turned on. - Support multiple conversions, unique for each chatID.
- Support login to OpenAI with password.
-
Make sure you have installed
Deno
already.If you don't, follow this official document to install. https://deno.land/manual@v1.28.3/getting_started/installation#download-and-install
-
Simply
git clone
or download this repo,cd
into the project folder. -
Cache dependencies and check integrity with
lock.json
, you only need to do this once.
deno cache --lock=lock.json chatbot.ts
- Complete Telegram bot token and ChatGPT session token in
env.example
.
BOT_TOKEN=YOUR_BOT_TOKEN
OPENAI_API_KEY=YOUR_OPENAI_API_KEY
To get your session token, see Get ChatGPT Session Token.
- Rename
env.example
to.env
mv env.example .env
deno run
and enjoy!
deno run chatbot.ts
Deno requires you to approve file system reading, enviroment variables access and network access manually. You can also run with these parammeters to give permission by default.
deno run --allow-read --allow-env --allow-net chatbot.ts
-
Sign up for an OpenAI account at https://beta.openai.com/signup
-
Generate a new API key at https://platform.openai.com/account/api-keys. This is your API key, anyone can use it to access your account which may cause unexpected charges. Keep it secret!
-
Paste it in your
.env
file.
- chatgpt-api Node.js client for the unofficial ChatGPT API. - License
- node-telegram-bot-api Telegram Bot API for NodeJS. - License
- Lodash - License
- One-third of final code & almost all the comments was written by Github Copilot. How far are we from the day where AI build whole project itself with AI 👀