Skip to content

sg-milad/ChatBuddy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telegram AI ChatBot

This is a Telegram bot built with Golang that integrates with the Gemini AI API to generate responses to user messages. The bot only replies when mentioned in a group chat and supports intelligent responses based on message context.

Features

  • AI-Powered Responses: Uses the Gemini AI API for smart and contextual replies.
  • Mention-Based Replies: Responds only when mentioned in group chats.
  • Dynamic Context Handling: Answers based on previous messages when replying.
  • Easy Deployment: Simple to run and deploy using Makefile.

Installation & Setup

Prerequisites

Clone the Repository

git clone https://github.com/yourusername/telegram-ai-bot.git
cd telegram-ai-bot

Configuration

  1. Create a .env file with:
    BOT_TOKEN=your_telegram_bot_token
    GEMINI_API_KEY=your_gemini_api_key

Running the Bot

Using go run

go run main.go config.go

Using Makefile

make run

Building the Bot

To compile the bot into a binary:

make build

The binary will be located in bin/mybot.

Usage

  User: Mention the bot in a group: `@YourBot what is 2+2?`
  Bot: 4

  User: What is Golang?
  User:@YourBot(replay on the message)
  Bot: Golang is a programming language developed by Google...

Contributing

Feel free to fork and submit a pull request!

License

MIT License


Made with ❤️ in Golang 🚀

About

Telegram bot built with Golang that integrates with the Gemini AI API to generate responses to user messages.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors