Skip to content

Latest commit

 

History

History
71 lines (59 loc) · 2 KB

README_en.md

File metadata and controls

71 lines (59 loc) · 2 KB

Gemini_Telegram_Bot

A Telegram Bot using Gemini API

Demo

Click

How to Install

(1) On Linux

  1. Install dependencies
pip install -r requirements.txt
  1. Obtain Telegram Bot API at BotFather
  2. Get Gemini API keys from Google AI Studio
  3. To run the bot, execute:
python main.py ${Telegram Bot API} ${Gemini API keys}

(2)Deploy Using Docker

build

  1. Get Telegram Bot API at BotFather
  2. Get Gemini API keys on Google AI Studio
  3. Clone repository
git clone https://github.com/H-T-H/Gemini-Telegram-Bot.git
  1. Enter repository directory.
cd Gemini-Telegram-Bot
  1. Build images
docker build -t gemini_tg_bot .
  1. run
docker run -d --restart=always -e TELEGRAM_BOT_API_KEY={Telegram Bot API} -e GEMINI_API_KEYS={Gemini API Key} gemini_tg_bot

(3)Deploy on Railway

Click on the button below for a one-click deployment.

Deploy on Railway

(4)Deploy on Zeabur

Click on the button below for a one-click deployment.

Deploy on Zeabur

How to Use

  1. If you want to communicate with the bot in a group, your chat must start with /gemini or /gemini_pro.
/gemini Who is John Lennon?
/gemini_pro Who is John Lennon?
  1. If you are having a private chat with the bot, you can directly send what you want.
Who is John Lennon?
  1. You can use the /clear command to delete the current conversation history.

  2. You can use the /switch command to switch the model.

Reference

  1. https://github.com/yihong0618/tg_bot_collections
  2. https://github.com/yym68686/md2tgmd/blob/main/src/md2tgmd.py