Skip to content

A simple serverless Telegram bot that uses ChatGPT and Cloudflare Workers

Notifications You must be signed in to change notification settings

evaleries/telegram-cf-chatgpt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Telegram BOT CF GPT

A Telegram bot that utilizes the power of ChatGPT to provide users with intelligent and engaging responses.

I'm using telegram bot template from cvzi/telegram-bot-cloudflare and simply call API to chatgpt as a response. With this bot, users can engage in natural language conversations and receive personalized responses that are tailored to their specific needs. (generated by ChatGPT)

You can deploy this bot to cloudflare worker with tutorial from cvzi.

Requirements

To deploy the bot, you required to have:

  • Telegram Bot (from: @BotFather)
  • Cloudflare Account
  • OpenAI API Key

Setup Instructions

  1. Create Telegram bot via @BotFather on Telegram
  2. Create Cloudflare Worker (Follow the steps by cvzi)
  3. Create Workers KV with name messages
  4. Bind the KV with workers via Worker's Setting -> Tab Variables -> KV Namespace Bindings
  5. Use variable name MESSAGES and choose messages KV Namespace, then press Save and deploy
  6. Quick edit the worker, and copy bot.js to the Cloudflare code editor
  7. Edit the TELEGRAM and OPENAI config in te code.
  8. Register webhook and try the bot✨
  9. Add two commands to the bot via BotFather (/start to start the bot and /clear to reset the conversation)

About

A simple serverless Telegram bot that uses ChatGPT and Cloudflare Workers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published