This is a Go-based Telegram bot that uses Cloudflare's AI to respond to user inputs in a casual and relatable manner. The bot maintains user-specific chat histories for personalized interactions.
- Personalized, relaxed responses based on user input.
- Supports private and group chats.
- Retrieves responses from Cloudflare AI endpoint.
- Stores user conversation history for continuous interaction.
Before running the bot, make sure you have the following:
- Go 1.18 or higher installed.
- A Telegram bot token (you can get it by talking to BotFather).
- Cloudflare API token and account ID to interact with their AI.
Ensure Go is installed, then run the following command to install necessary dependencies:
go mod tidy
This will fetch all the required packages specified in the project.
Create a .env
file in the root directory of the project and add the following variables:
BOT_TOKEN=your_telegram_bot_token
CF_ID=your_cloudflare_account_id
CF_TOKEN=your_cloudflare_api_token
- Replace
your_telegram_bot_token
with the Telegram bot token you got from BotFather. - Replace
your_cloudflare_account_id
andyour_cloudflare_api_token
with the corresponding Cloudflare values.
After setting up your environment variables, run the bot using:
go run main.go
Or
./deployment.sh