Telegram bot that reponds through the Gemini API. Python script utilizes python-telegram-bot.
![](https://private-user-images.githubusercontent.com/87616300/342819278-29cbb0d7-6296-4dc2-aae2-51d7656aaa99.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2NTgwMzEsIm5iZiI6MTczOTY1NzczMSwicGF0aCI6Ii84NzYxNjMwMC8zNDI4MTkyNzgtMjljYmIwZDctNjI5Ni00ZGMyLWFhZTItNTFkNzY1NmFhYTk5LmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDIyMTUzMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk4YTQ0YTljMzM1Yjk2MGI4ZDQxOGU4ZTBmNWM3OTdhNWIwODA5NmQyM2UzNWRmMTU0NGEyNTcxMGVjYjczYzImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.u-R5UpNrExEg4jHj8CeSbcT21QNrnq2KVQcQRSFrR2g)
- Install python-telegram-bot using
pip install python-telegram-bot
. - Create a bot using @botfather inside Telegram app.
- Paste bot's 'username' and 'token' in the Python script. Test basic commands to make sure things are alright.
- Create Gemini API key using ai.google.dev. Paste the key in the script.
- Rejoice!
- Use the start command to start the bot and it should start working.
- To get a response in supergroups, either tag its username directly or use the word 'mirror' in your message.
- To make it respond using Gemini, use the word 'gen' in your message. The requirement of 'gen' has been made so that someone does not accidently misuse their API key and incur charges.