This a personal Telegram bot I created for easy (and cheap) access to ChatGPT. It is using gpt-3.5-turbo-0301
, but you can choose whatever modal you want in src/index.ts
.
In order to use this project you have to:
- Signup to openai.com/.
- create a Telegram bot. See official documentation, and simple serverless lambda example.
- create an AWS account.
- run
yarn
- run
cp .env.example .env
- Paste your openai key to
OPENAI_API_KEY=
. You can find your token here. - Paste your Telegram token you got when you created the bot via
BotFather
toTELEGRAM_BOT_TOKEN=
- Add your AWS Profile to the
AWS_PROFILE=<profile-name>
, or just login to your aws account viaaws sso
. - run
yarn serverless
- After previous command ends successfully, you should be able to see the url for your deployed lambda.
Use the Lambda's URL and Bot token in following command to set up your bot's webhook:
curl --request POST --url https://api.telegram.org/bot<TELEGRAM_BOT_TOKEN>>/setWebhook --header 'content-type: application/json' --data '{"url": "<URL_OF_LAMBDA>"}'
🎉 you have access to ChatGPT via your personal Telegram bot now 🎉
- add config command for providing an
OPENAI_API_TOKEN
- add config command for changing the used
modal
- add config command for changing
role
ofmodel
.