Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/abhithemodder/gemini-ai-telegram

Pyrogram(Pyrofork) Based Python script for Telegram Userbots and Bots
https://github.com/abhithemodder/gemini-ai-telegram

gemini gemini-api google-generative-ai pyrofork pyrogram pyrogram-bot pyrogram-userbot pyrogram-userbotplugin telegram-bot telegram-userbot

Last synced: about 1 month ago
JSON representation

Pyrogram(Pyrofork) Based Python script for Telegram Userbots and Bots

Awesome Lists containing this project

README

        

# gemini-ai-telegram


![GitHub Repo stars](https://img.shields.io/github/stars/AbhiTheModder/gemini-ai-telegram)

**Pyrogram(Pyrofork) Based Python script for Telegram Userbots and Bots**

### πŸ“Ή You can checkout the demo video:
- Using for bots: [Here](https://x.com/Qbtaumai/status/1736681149047726176?s=20)
- Using as UserBot: [Here](https://x.com/Qbtaumai/status/1736681423703351629?s=20)

# πŸš€ Demo
**Try it Out in Telegram:** [Here](https://t.me/gemini_testbot)

## ☁️ Cloud Host:

## πŸ‹ Docker:
**[Instructions](docker.md)**

## πŸ“¦ Requirements:
- Python >=3.9 [Best if >=python3.11]
- Get API_KEY : [Obtain an API key from AI Studio](https://makersuite.google.com/app/apikey)
- Get BOT_TOKEN of your bot from [@BotFather](https://t.me/botfather)
- Get API_ID and API_HASH from my.telegram.org -> `Api development tools` option
- pyrofork : `pip install pyrofork`
- google-generativeai : `pip install google-generativeai`
- PIL : `pip install Pillow` `# Only if you want to use 'aimage.py/google-pro-vision' model`

## πŸ—’οΈ Note:
**Users in termux may face issue with installation of `google-generativeai`**
- To fix it install these libraries first:
- `pkg update && pkg upgrade -y`
- `pkg install python`
- `pkg install openssl zlib c-ares -y`
- Install `grpcio` through below command:
```
GRPC_PYTHON_DISABLE_LIBC_COMPATIBILITY=1 GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1 GRPC_PYTHON_BUILD_SYSTEM_CARES=1 CFLAGS+=" -U__ANDROID_API__ -D__ANDROID_API__={YOUR API LEVEL} -include unistd.h" LDFLAGS+=" -llog" pip install grpcio
```
**πŸ—’οΈNote:** Make sure to put your own `ANDROID_API` to which your device/android OS version sdk is on(based)
- OR If you're too lzy to compile yourself and your API LEVEL is 33(Android OS: 13), Lucky You because I've pushed release of compiled wheels in [releases](https://github.com/AbhiTheModder/gemini-ai-telegram/releases/) section of this repo :D

OR Through `TUR` Repo:
```shell
python -m pip install grpcio --extra-index-url https://termux-user-repository.github.io/pypi/
```

- Now install `google-generativeai`:
```
pip install google-generativeai
```

# πŸƒ Usage:
- Except for Termux users simply `pip install -r requirements.txt` is enough
- AGAIN make sure to get your api keys :D
- **Userbots:**
Use files starting with `ub`, Fill the keys and you're good to go
- **Simple Bots:**
Use files starting with `bot`, Fill the keys and you're good to go

- You can also use `botmerged.py` if you want to integrate both models to your bot
- **Group Bot**
Use file starting with `botmrg_grp.py`
- It has feature of allowing use in private also and without commands allowing user to interact like chatting with someone

## TODO
Γ— Chat History Support

## πŸ’– Like my work?
This project needs a ⭐ from you. Don't forget to leave a ⭐.

## πŸ‘¨β€πŸ’» CREDITS:
- [Pyrofork](https://github.com/Mayuri-Chan/pyrofork/)
- [GeminiAi](https://blog.google/technology/ai/google-gemini-ai/)
- Myself :D