Deploy this function on flows.network, and you will get a Telegram bot that uses ChatGPT to respond to every question in your Telegram DM or channel/group automatically.
The example in the above image is to leverage ChatGPT to generate code comments.
-
You will need an OpenAI API key. If you do not already have one, sign up here.
-
You also need a Telegram token to access the HTTP API. If you don't already have one, go to Telegram to get a telegram bot token from @bothfather.
To install the ChatGPT Telegram App, we will use flows.network, a serverless platform that makes deploying your own app quick and easy in just three steps.
Fork this repo and go to flows.network to deploy your function.
-
Sign up for an account for deploying flows on flows.network. It's free.
-
Click on the "Create a Flow" button to start deploying the ChatGPT GitHub APP
-
Authenticate the flows.network to access the
telegram-gpt
repo you just forked. -
Click the Advanced test to see more settings. Here we need to use Environment Variables to pass the Telegram token and OpenAI API key name.
telegram_token
: Fill in the token you received from Fatherbot.openai_key_name
: Fill in the name you want to name your OpenAI key.
- At last, click the Deploy button to deploy your function.
After that, the flows.network will direct you to configure the SaaS integration required by your flow. Since we have configured Telegram in the above step, OpenAI is the only SaaS we need to configure here.
Click the "Connect/+ Add new authentication" button to authenticate your OpenAI account. You'll be redirected to a new page where you can copy and paste your OpenAI API key and then name the key. Note that the name you enter here should be the same as the name in the environment variables.
Click the Check button to see your flow details. As soon as the flow function's status becomes ready
and the flow's status becomes running
, the Telegram ChatGPT App goes live. Go ahead and chat with ChatGPT by sending a message on your Telegram! You can also invite this bot to your channel/group.
flows.network is still in its early stages. We would love to hear your feedback!
If you want to build locally, make sure you have installed Rust and added wasm32-wasi
traget.
cargo build --target wasm32-wasi --release