father-bot / chatgpt_telegram_bot

💬 Telegram bot with ChatGPT, Python-based, using OpenAI's API.
https://t.me/chatgpt_karfly_bot
MIT License
5.18k stars 1.81k forks source link

Update bot.py. An easy way to get the ID of group and private chats to restrict access for unauthorized access. #436

Closed wladradchenko closed 8 months ago

wladradchenko commented 8 months ago

Hello, I want to express my gratitude for this project. I personally use it and greatly appreciate the value it brings. However, I've identified a feature gap that I believe could significantly enhance its utility for myself and others. Specifically, the ability for the bot to operate exclusively within predetermined chats or with certain users, accompanied by an easy method to display user and chat IDs in messages for administrative purposes.

CHANGELOG:

If an attempt is made to interact with the bot outside of permitted groups and private chats, the bot will respond with a message containing the required group or user ID. This provides a simple mechanism for administrators to manage access permissions.

I kindly request the incorporation of these changes into the main codebase to obviate the need for manual updates and to offer a more user-friendly experience to all users.

Thank you.