Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/simatwa/telegram-chatbots

Personal Telegram bot for ChatGPT and Bard
https://github.com/simatwa/telegram-chatbots

bard bard-bot bot bots chatgpt chatgpt-bot telegram-bot

Last synced: 10 days ago
JSON representation

Personal Telegram bot for ChatGPT and Bard

Awesome Lists containing this project

README

        

telegram-chatbots


License

Latest release
release date
Black
wakatime


Bot Demo

Unofficial Telegram bot for ChatGPT and Bard

## Features

* Intergratin with [Bard](https://bard.google.com)
* Intergration with [ChatGPT](https://chat.openai.com)
* Parse [awesome-chatgpt-prompts](https://github.com/f/awesome-chatgpt-prompts) on the fly.

## Pre-requisites

1. [Python](https://python.org)>=3.10 Installed
2. [Telegram Bot token](https://core.telegram.org/bots#botfather)

## Installation

Clone and install dependencies

```
git clone https://github.com/Simatwa/telegram-bots
cd telegram-chatbots
pip install -r requirements.txt
```

## Usage

It is presumed that you're in possession of [Telegram Bot Token](https://telegram/), if that's not the case then have one from [@BotFather](https://core.telegram.org/bots#botfather).

Since this script depends on [GoogleBard](https://github.com/acheong08/Bard) and [WebChatGPT](https://github.com/Simatwa/WebChatGPT) libraries, purpose to walkthrough their documentations then use that knowledge to find the required information stated in the [env](env) file.

They include :

| Variable | Info |
| ---------- | ------- |
| [bard](https://github.com/acheong08/Bard) | Google's bard session key |
| [openai_cookie_file](https://github.com/Simatwa/WebChatGPT) | Path to openai-cookie-file.json |

After filling the [env](env) file, rename it to `.env` and vallah! You're just one step away.

Since this is a **personal** bot, you have to uniquely identify yourself with the bot, so you'll be required to hunt down your **user id**.

So fire up the bot, `python user_id.py` and then on the chat panel, send this command `myId` inorder for the bot to echo back your *Telegram's User ID*. Add the id to the [`.env`](env) file as `users_id=`. If you would like multiple users to access the bot, add their IDs as well separated by commas. i.e `users_id=11223344,55667788`.

Simply run `python main.py` and have some fun.

## Disclaimer

The code in this repository is an unofficial implementation and integration of OpenAI's ChatGPT and Bard models. It is not endorsed or supported by either partys. In addition, this code might not reflect the latest practices or updates from them. It is provided as-is, and there are no guarantees regarding its performance, reliability, or security. Use it at **Your Own Risk**. The developer of this repository disclaim any liability for the usage or consequences of utilizing these scripts.