Some of the things being assumed here
- You have installed python3.7 or above.
- You have created a virtual environment (recommended but not mandatory).
- You have used pip to install from the requirements.txt file.
Warning Do not expose the
BOT_TOKEN
Link for generating BOT_TOKEN: https://medium.com/geekculture/generate-telegram-token-for-bot-api-d26faf9bf064
Warning Do not expose the
__Secure-1PSID
Since Google Bard is being used as the AI backend, you need to fetch the BARD_API_KEY from Bard.
- Visit https://bard.google.com/
- F12 for console
- Session: Application → Cookies → Copy the value of
__Secure-1PSID
cookie.
Note that while I referred to __Secure-1PSID
value as an API KEY for convenience, it is not an officially provided API KEY.
Cookie value subject to frequent changes. Verify the value again if an error occurs. Most errors occur when an invalid cookie value is entered.
Creating .env file inside telegram_ai_bot/ directory from which the BOT_TOKEN and BARD_API_KEY will be fetched.
BOT_TOKEN=xxxxxxxxxx
BARD_API_KEY=xxxxxxxxxx
From the base directory run:
python3 -m telegram_ai_bot.src.ai_telegram_bot_async
Bard-API is a powerful Python library that provides functionality for using Bard's webserver for getting your answers.
The Bard-API library is released under the MIT License. Please refer to the Bard-API's license file for detailed terms and conditions.
For more information about Bard-API, please visit the Bard-API GitHub repository.
Bard's service status and Google's API interfaces are in constant flux. The number of replies is currently limited, but certain users, such as those utilizing VPNs or proxy servers, have reported slightly higher message caps. Adaptability is crucial in navigating these dynamic service policies. Please note that the cookie values used in this package are not official API values.
The user assumes all legal responsibilities associated with using the BardAPI package and Telegram-AI-bot project. This Python project merely facilitates easy access to Google Bard Telegram Bot for developers. Users are solely responsible for managing data and using the package appropriately. For further information, please consult the Google Bard Official Documentation.
This Python project is not an official Google package or API service. It is not affiliated with Google and uses Google account cookies, which means that excessive or commercial usage may result in restrictions on your Google account. The project was created to support developers in testing functionalities due to delays in the official Google package. However, it should not be misused or abused. Please be cautious and refer to the Readme for more information.
This project is licensed under the GNU General Public License (GPL) version 3.0. By using, contributing, or redistributing this project, you agree to abide by the terms and conditions of the GPL. You can find a copy of the license in the LICENSE file.