Try this simple bot created from this template.
- Create a flow function
- Configure the flow function to access the Telegram bot
- Configure the flow function to access an LLM backend
You will need to #to flows.network from your GitHub account. It is free.
You also need a bot token to access the Telegram API. If you don't already have one, go to Telegram to get a bot token from @botfather.
Just fork this repo to your own GitHub account.
Then, from flows.network, you can "Create a Flow" and select your forked repo. It will create a flow function based on the code in your forked repo.
Click on the "Advanced" button to see configuration options for the flow function.
-
You will need to bring your own OpenAI API key. If you do not already have one, # here.
-
You also need a bot token to access the Telegram API. If you don't already have one, go to Telegram to get a bot token from @botfather.
- Create a bot from a template
- Add your ChatGPT API key
- Add the telegram bot token
Here you can see three variables. You can customize the system_prompt
variable to prompt ChatGPT.
Click on the Create and Build button.
You will now set up OpenAI integration. Click on Connect, and enter your key.
Close the tab and go back to the flow.network page once you are done. Click on Continue.
You will now set up Telegram integration. Enter your Telegram token here.
Click on Deploy button.
As soon as the flow function's status becomes ready
and the flow's status becomes running
, the Telegram Telegram bot goes live. Go ahead and send a private message to the bot! You can also invite this bot to your channel/group.