Giter Site home page Giter Site logo

f33rni / gpt-telegramus Goto Github PK

View Code? Open in Web Editor NEW
326.0 10.0 102.0 9.78 MB

💜 The best free Telegram bot for ChatGPT, Microsoft Copilot (aka Bing AI / Sidney / EdgeGPT), Microsoft Copilot Designer (aka BingImageCreator), Gemini and Groq with stream writing, requests with images, multiple languages, admin control, data logging and more!

License: GNU Affero General Public License v3.0

Python 99.59% Shell 0.03% Dockerfile 0.38%
bot chatgpt gpt linux openai python telegram ai dalle edge-ai

gpt-telegramus's Introduction

🤖 GPT-Telegramus v5

GPT-Telegramus logo

The best free Telegram bot for ChatGPT, Microsoft Copilot (aka Bing AI / Sidney / EdgeGPT), Microsoft Copilot Designer (aka BingImageCreator), Gemini and Groq with stream writing, requests with images, multiple languages, admin control, data logging and more!

YouTube Bandcamp Spotify SoundCloud

Project banner


🚧 GPT-Telegramus is under development

😔 Currently, GPT-Telegramus doesn't have paid ChatGPT and DALL-E support

📈 GPT-Telegramus v5 is an updated and highly refactored version of the old GPT-Telegramus

📄 Documentation is also under development! Consider reading docstring for now

🐛 If you find a bug in GPT-Telegramus, please create an Issue

p.s. Due to my studies, I don't have much time to work on the project 😔


😋 Support project

💜 Please support the project so that I can continue to develop it

  • BTC: bc1qd2j53p9nplxcx4uyrv322t3mg0t93pz6m5lnft

  • ETH: 0x284E6121362ea1C69528eDEdc309fC8b90fA5578

  • ZEC: t1Jb5tH61zcSTy2QyfsxftUEWHikdSYpPoz

  • Or by my music on 🟦 bandcamp

  • Or message me if you would like to donate in other way 💰

Star History Chart


🤗 Contributors

  • 💜 Sprav04ka - Tofii'skovyi' language, Testing, Super beautiful poster, Project Logo, Motivation
  • 💜 Hanssen - Markdown parsing, bard images, /chat command, caption fix, loading emoji, dynamic splitting, code block splitting, Gemini module, Docker fix, GitHub actions fix and much much more
  • 💜 Sergey Krashevich - Docker, GitHub Actions
  • 💜 Wahit Fitriyanto - Indonesian language
  • 💜 Alexander Fadeyev - EdgeGPT Fix
  • 💜 AnthroAsja - Belarusian language
  • 💜 Anonymous Samurai - Ukrainian language
  • 💜 Dunya Jafari - Persian language
  • 💜 Dedy Rudney - French language

📨 Project channel and demo

⚠️ Please do not overload the bot and use it only as a demo version


🏗️ Requirements

  • Python 3.10 / 3.11 (not tested on other versions)
  • Unblocked access to the telegram bot official API
  • Other requirements specified in the requirements.txt file

📙 Project based on


❓ Get started

See 🐧 Running as service on linux, 🍓 Running on Raspberry Pi (ARM), 🐋 Running in Docker sections for more info

  1. Install Python 3.10 / 3.11 (not tested on other versions), venv and pip
  2. Download source code (clone repo)
  3. Create venv python -m venv venv / python3 -m venv venv / python3.10 -m venv venv / python3.11 -m venv venv
  4. Activate venv source venv/bin/activate / venv\Scripts\activate.bat
  5. Check python version using python --version command
  6. Install requirements pip install -r requirements.txt --upgrade
  7. Carefully change all the settings in config.json file and in each *.json file inside module_configs directory. If you have questions regarding any setting, open an issue, I'll try to add a more detailed description
  8. Run main script python main.py
  • 💬 ChatGPT
    • Free browser-like Chat-GPT. Currently, without extensions and image requests (text only) (because I don't have a paid account to test it)
    • Stream response support
    • Chat history support
    • See https://github.com/F33RNI/LlM-Api-Open for more info
  • 🟦 Microsoft Copilot (aka EdgeGPT aka Bing AI aka Sydney)
    • Supports conversation style /style
    • Stream response support
    • Chat history support
    • Web-browsing (probably) and sources (attributions) support
    • Accepts image requests (for lmao_ms_copilot only)
    • Send generated images (for lmao_ms_copilot only)
    • Suggestions (for lmao_ms_copilot only)
    • See https://github.com/F33RNI/LlM-Api-Open for more info
    • NOTE: Non-LMAO API (the old one ms_copilot) is deprecated! Please use lmao_ms_copilot instead
  • 🎨 Microsoft Copilot Designer (DEPRECATED)
    • Bing Image Generator. Used as a separate module due to issues with the EdgeGPT module
    • Free and unlimited
  • Gemini
    • Google's AI using the Gemini Pro model
    • Chat history support
    • Requests with images (you can send an image with text to it)
    • Requests with images will not be recorded in the chat history since Google hasn't support this
  • 🔴 Groq
    • Official Python API
    • Chat history support
    • Very fast response
    • Multiple models (see /model command)

🐧 Running as service on linux

  1. Install Python 3.10 / 3.11 (not tested on other versions), venv and pip

  2. Clone repo

    1. git clone https://github.com/F33RNI/GPT-Telegramus.git
    2. cd GPT-Telegramus
  3. Create venv python -m venv venv / python3 -m venv venv / python3.10 -m venv venv / python3.11 -m venv venv

  4. Carefully change all the settings in config.json file and in each *.json file inside module_configs directory

  5. Install systemd

    1. sudo apt-get install -y systemd
  6. Create new service file

    1. sudo nano /etc/systemd/system/gpt-telegramus.service

      [Unit]
      Description=GPT-Telegramus service
      After=multi-user.target
      
      [Service]
      Type=simple
      Restart=on-failure
      RestartSec=5
      
      WorkingDirectory=YOUR DIRECTORY HERE/GPT-Telegramus
      ExecStart=YOUR DIRECTORY HERE/GPT-Telegramus/run.sh
      
      [Install]
      WantedBy=multi-user.target
      
  7. Reload systemctl daemon

    1. sudo systemctl daemon-reload
  8. Enable and start service

    1. sudo systemctl enable gpt-telegramus
    2. sudo systemctl start gpt-telegramus
  9. Note: Please use sudo systemctl kill gpt-telegramus and then sudo systemctl stop gpt-telegramus if only sudo systemctl stop gpt-telegramus not working


🍓 Running on Raspberry Pi (ARM)

  1. Install Python 3.11 or later (not tested) if not installed

    1. sudo apt-get update
      sudo apt-get install -y build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev
      wget https://www.python.org/ftp/python/3.11.8/Python-3.11.8.tgz
      sudo tar zxf Python-3.11.8.tgz
      cd Python-3.11.8
      sudo ./configure --enable-optimizations
      sudo make -j 4
      sudo make altinstall
    2. Check version by typing python3.11 -V. After this, you should use python3.11 command instead of python or you can add it to the bashrc by typing echo "alias python=/usr/local/bin/python3.11" >> ~/.bashrc

  2. Follow the 🐧 Running as service on linux guide


🐋 Running in Docker

From GitHub Package

  1. Clone repo or download config.json and module_configs and langs

  2. Edit the config.json, set options in the files section to the path in the container (/app/config/<FILE_NAME>)

  3. Run the container

    docker run -d -e TELEGRAMUS_CONFIG_FILE="/app/config/config.json" -v <YOUR_CONFIG_FOLDER>:/app/config --name gpt-telegramus --restart on-failure ghcr.io/f33rni/gpt-telegramus:latest

    If you want to try the preview version

    docker run -d -e TELEGRAMUS_CONFIG_FILE="/app/config/config.json" -v <YOUR_CONFIG_FOLDER>:/app/config --name gpt-telegramus --restart on-failure ghcr.io/f33rni/gpt-telegramus:edge

Build Manually

  1. Install Docker

  2. Clone repo

  3. Build container

    docker buildx build -t telegramus --load -f Dockerfile .
  4. Run the container

    docker run -d --name gpt-telegramus --restart on-failure telegramus

    or if you want to use a custom config

    docker run -d -e TELEGRAMUS_CONFIG_FILE="/app/config/config.json" -v <YOUR_CONFIG_FOLDER>:/app/config --name gpt-telegramus --restart on-failure telegramus

🌐 Bot messages

Currently available languages

  • 🇺🇸 English
  • 🇷🇺 Русский
  • ‍☠️ Тофийсковый
  • 🇮🇩 Bahasa Indonesia
  • 🇨🇳 简体中文
  • 🇧🇾 Беларуская
  • 🇺🇦 Українська
  • فارسی 🇮🇷
  • 🇪🇸 Español
  • 🇻🇳 Vietnamese
  • 🇫🇷 Français

You can add a new language. For that:

  1. Copy any existing language file (inside langs directory)
  2. Rename it according to Set2/T (3-letters code) ISO 639 https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes
  3. Translate each entry
  4. Create a pull request 💜

You can add new lines by adding \n

⚠️ Please make sure you haven't messed up the string formatting structure {this_type}


🤖 Telegram bot commands

  • 📄 /start - Welcome message and bot version
  • /help - Show help message
  • ↕️ /module - Change module to chat with
  • 🧹 /clear - Clear chat history
  • 🌎 /lang - Change the language
  • 🆔 /chatid - Show your chat_id
  • ⚙️ /model - Change model of module (Currently for 🔴 Groq module only)
  • /style - Bing AI conversation style
  • /chat - Send request in group chat
  • Other direct module commands (please check automatically-generated list of commands inside bot)

Admin commands

  • 💬 /queue - Show requests queue
  • 🔃 /restart [module name, optional] - Restart specific module (and it's config) or every module and all configs, languages and bot commands
    • Please see bot_command_restart function in bot_handler.py file for more info
  • 👤 /users - Show list of all users
  • 🔨 /ban <id> [reason] - Ban a user by their id with reason (optional)
  • 🔓 /unban <id> - Unban a user by their id
  • 📢 /broadcast <message> - Send text message to everyone except banned users

📜 Data collecting

GPT-Telegramus has a built-in data collecting function (saves requests and responses in a files)

  • For text requests / responses will be saved as plain text
  • For image requests / responses will be saved as Base64-encoded image (in the same text file)

You can enable and configure data collection in config.json in data_collecting section

⚠️ Please make sure you notify your bot users that you're collecting data


📝 TODO

  • Paid version of ChatGPT
  • DALL-E (from OpenAI)
  • Some other LLMs (and maybe some free GPT-4 model)

✨ Contribution

  • Anyone can contribute! Just create a pull request

gpt-telegramus's People

Contributors

alfsoft avatar f33rni avatar hanssen0 avatar hung319 avatar rudney5000 avatar skrashevich avatar sprav04ka avatar thesl18 avatar wahitftry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gpt-telegramus's Issues

Bot generation code very slow

Bot generation code very slow and almost time out, even though you've set a 480-second timeout. Text generation works fine
image

/users should show tg://user?id={user_id}

command "/users" should show "tg://user?id={user_id}" links instead of clear text with user ID.
we need some quick method to check if we know that user before ban.
we can't check it only by name and ID, beacuse name can be same for many users and IDs is hidden in tg clients.

opening tg:// links works from mobile tg clients.

or may be you can use https://t.me/{username} links if bot can get this info from users (not IDs)

Event loop is closed

Asking ChatGPT (API type 3)...
[2023-08-08 11:43:46] [15356   ] [INFO    ] Saving conversation 6ccc2566-faee-4371-9df7-139355eef3bb
[2023-08-08 11:43:46] [15356   ] [INFO    ] Loading users.json
[2023-08-08 11:43:46] [15356   ] [INFO    ] Loaded json from users.json
[2023-08-08 11:43:46] [15356   ] [INFO    ] Saving to users.json
[2023-08-08 11:43:46] [15356   ] [INFO    ] Response successfully processed for user Иван Колипов (1311323594)
[2023-08-08 11:43:47] [15356   ] [WARNING ] Error sending reply with escape_mode 0: Can't parse entities: character '!' is reserved and must be escaped with the preceding '\'         You can ignore this message
[2023-08-08 11:43:47] [15356   ] [INFO    ] Trying to close ChatGPT session
[2023-08-08 11:43:47] [15356   ] [INFO    ] ChatGPT module exited
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x000002257489C670>
Traceback (most recent call last):
  File "C:\Users\ulyas\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "C:\Users\ulyas\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "C:\Users\ulyas\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 750, in call_soon
    self._check_closed()
  File "C:\Users\ulyas\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 515, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x000002257489C670>
Traceback (most recent call last):
  File "C:\Users\ulyas\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "C:\Users\ulyas\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "C:\Users\ulyas\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 750, in call_soon
    self._check_closed()
  File "C:\Users\ulyas\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 515, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x000002257489C670>
Traceback (most recent call last):
  File "C:\Users\ulyas\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "C:\Users\ulyas\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "C:\Users\ulyas\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 750, in call_soon
    self._check_closed()
  File "C:\Users\ulyas\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 515, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
[2023-08-08 11:43:47] [14292   ] [INFO    ] Trying to kill process with PID 15356
[2023-08-08 11:43:47] [14292   ] [INFO    ] Killed? True
[2023-08-08 11:43:47] [14292   ] [INFO    ] The response were written to the file: data\2023_08_08_11_43_43.log
[2023-08-08 11:43:47] [14292   ] [INFO    ] Container with id 1074532337 (PID 15356) was removed from the queue

I'm assuming these errors are not normal

i have an issue in edge gpt

❌ Error: 'conversationSignature'

Make another request or try again later

I have tried every thing but it not work

404 page not found

I did everything according to the instructions, but after everything I get an error 404

Auto cookie google bard

Is there a way to add auto cookie in google bard as after some time the Bard cookie changed and again we have to add is there is any way to fix that

error ,cannot response

2023-02-16 11:23:46 ERROR No error handlers are registered, logging exception.
Traceback (most recent call last):
File "/usr/local/python3/lib/python3.9/site-packages/telegram/ext/_updater.py", line 607, in _network_loop_retry
if not await action_cb():
File "/usr/local/python3/lib/python3.9/site-packages/telegram/ext/_updater.py", line 335, in polling_action_cb
raise exc
File "/usr/local/python3/lib/python3.9/site-packages/telegram/ext/_updater.py", line 320, in polling_action_cb
updates = await self.bot.get_updates(
File "/usr/local/python3/lib/python3.9/site-packages/telegram/ext/_extbot.py", line 524, in get_updates
updates = await super().get_updates(
File "/usr/local/python3/lib/python3.9/site-packages/telegram/_bot.py", line 331, in decorator
result = await func(*args, **kwargs) # skipcq: PYL-E1102
File "/usr/local/python3/lib/python3.9/site-packages/telegram/_bot.py", line 3510, in get_updates
await self._post(
File "/usr/local/python3/lib/python3.9/site-packages/telegram/_bot.py", line 419, in _post
return await self._do_post(
File "/usr/local/python3/lib/python3.9/site-packages/telegram/ext/_extbot.py", line 306, in _do_post
return await super()._do_post(
File "/usr/local/python3/lib/python3.9/site-packages/telegram/_bot.py", line 450, in _do_post
return await request.post(
File "/usr/local/python3/lib/python3.9/site-packages/telegram/request/_baserequest.py", line 165, in post
result = await self._request_wrapper(
File "/usr/local/python3/lib/python3.9/site-packages/telegram/request/_baserequest.py", line 330, in _request_wrapper
raise Conflict(message)
telegram.error.Conflict: Conflict: terminated by other getUpdates request; make sure that only one bot instance is running
2023-02-16 11:23:49 INFO /gpt command from user min long request: hello
2023-02-16 11:23:49 INFO Asking: hello
error: Unknown error
2023-02-16 11:23:49 ERROR Unknown error
Traceback (most recent call last):
File "/opt/GPT-Telegramus/AIHandler.py", line 140, in gpt_loop
asyncio.new_event_loop().run_until_complete(chatbot_async_result())
File "/usr/local/python3/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/opt/GPT-Telegramus/AIHandler.py", line 136, in chatbot_async_result
async for line in self.chatbot.ask(str(container.request)):
File "/usr/local/python3/lib/python3.9/site-packages/revChatGPT/V2.py", line 177, in ask
raise Exception("Unknown error")
Exception: Unknown error

Can i run this code in github actions

Can you help me to run this code in github actions I have tried to host this bot in docker but it has errors not deployed on docker hub if there is a way to host this bot in github actions please tell me

commands to providers

the ability to select which module we want to print with the command, for example:
/bing what is atom?
/chatgpt what is atom?

conversationSignature

Greetings. I downloaded the latest version, but the "conversationSignature" error hasn't gone anywhere. I tried to fix this error from this problem(#62), but nothing helped.
What can be done?
(i use bing, EdgeGPT)

bing image gen not woriking

the bing image is not working

"❌ Error clearing chat history!

Error.init() missing 3 required positional arguments: 'location', 'status_code', and 'details"

this error is coming in my telegram

To call when needed in chats

Sir, it is very impressing but there will be more comfort as we can call it when needed with specific command in chats as now it is replying to all massage.
thanks sir

Add command to restart telegram bot

Sometimes, messages to bot are always in queue (Add to the queue. Position: x/5 ),and no any response.
I have to restart docker container manually then it will be working again.
Is it possible to add a command like /restart which can restart the program automatically?

There's some log below while bot not answering.

2023-02-27 22:04:46 ERROR No error handlers are registered, logging exception.
Traceback (most recent call last):
File "h2/connection.py", line 224, in process_input
KeyError: (<ConnectionState.CLOSED: 3>, <ConnectionInputs.RECV_WINDOW_UPDATE: 13>)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "httpcore/_async/http2.py", line 112, in handle_async_request
File "httpcore/_async/http2.py", line 229, in _receive_response
File "httpcore/_async/http2.py", line 260, in _receive_stream_event
File "httpcore/_async/http2.py", line 281, in _receive_events
File "httpcore/_async/http2.py", line 343, in _read_incoming_data
File "h2/connection.py", line 1463, in receive_data
File "h2/connection.py", line 1487, in _receive_frame
File "h2/connection.py", line 1728, in _receive_window_update_frame
File "h2/connection.py", line 228, in process_input
h2.exceptions.ProtocolError: Invalid input ConnectionInputs.RECV_WINDOW_UPDATE in state ConnectionState.CLOSED

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "httpx/_transports/default.py", line 60, in map_httpcore_exceptions
File "httpx/_transports/default.py", line 353, in handle_async_request
File "httpcore/_async/connection_pool.py", line 253, in handle_async_request
File "httpcore/_async/connection_pool.py", line 237, in handle_async_request
File "httpcore/_async/connection.py", line 90, in handle_async_request
File "httpcore/_async/http2.py", line 142, in handle_async_request
httpcore.LocalProtocolError: Invalid input ConnectionInputs.RECV_WINDOW_UPDATE in state ConnectionState.CLOSED

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "telegram/request/_httpxrequest.py", line 199, in do_request
File "httpx/_client.py", line 1533, in request
File "httpx/_client.py", line 1620, in send
File "httpx/_client.py", line 1648, in _send_handling_auth
File "httpx/_client.py", line 1685, in _send_handling_redirects
File "httpx/_client.py", line 1722, in _send_single_request
File "httpx/_transports/default.py", line 353, in handle_async_request
File "contextlib.py", line 137, in exit
File "httpx/_transports/default.py", line 77, in map_httpcore_exceptions
httpx.LocalProtocolError: Invalid input ConnectionInputs.RECV_WINDOW_UPDATE in state ConnectionState.CLOSED

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "telegram/ext/_updater.py", line 607, in _network_loop_retry
File "telegram/ext/_updater.py", line 335, in polling_action_cb
File "telegram/ext/_updater.py", line 320, in polling_action_cb
File "telegram/ext/_extbot.py", line 524, in get_updates
File "telegram/_bot.py", line 331, in decorator
File "telegram/_bot.py", line 3510, in get_updates
File "telegram/_bot.py", line 419, in _post
File "telegram/ext/_extbot.py", line 306, in _do_post
File "telegram/_bot.py", line 450, in _do_post
File "telegram/request/_baserequest.py", line 165, in post
File "telegram/request/_baserequest.py", line 288, in _request_wrapper
File "telegram/request/_baserequest.py", line 274, in _request_wrapper
File "telegram/request/_httpxrequest.py", line 223, in do_request
telegram.error.NetworkError: httpx.LocalProtocolError: Invalid input ConnectionInputs.RECV_WINDOW_UPDATE in state ConnectionState.CLOSED

Bing ImageGen Error reading bing cookies!

Bing Ai chatbot is working fine but ImageGen is not. The logs say that, this error occurred due to cookies, but if the cookies were faulty, wouldn't the Bing AI chat bot also not work?

"
2023-11-12T16:28:14.578574+00:00 app[worker.1]: [2023-11-12 16:28:14] [167 ] [INFO ] Logging setup is complete for current process
2023-11-12T16:28:14.578751+00:00 app[worker.1]: [2023-11-12 16:28:14] [167 ] [INFO ] Logging setup is complete for current process
2023-11-12T16:28:14.579576+00:00 app[worker.1]: [2023-11-12 16:28:14] [167 ] [INFO ] Loading users.json
2023-11-12T16:28:14.579600+00:00 app[worker.1]: [2023-11-12 16:28:14] [167 ] [INFO ] Loading users.json
2023-11-12T16:28:14.579907+00:00 app[worker.1]: [2023-11-12 16:28:14] [167 ] [INFO ] Loaded json from users.json
2023-11-12T16:28:14.579936+00:00 app[worker.1]: [2023-11-12 16:28:14] [167 ] [INFO ] Loaded json from users.json
2023-11-12T16:28:14.580029+00:00 app[worker.1]: [2023-11-12 16:28:14] [167 ] [INFO ] Saving to users.json
2023-11-12T16:28:14.580054+00:00 app[worker.1]: [2023-11-12 16:28:14] [167 ] [INFO ] Saving to users.json
2023-11-12T16:28:14.580722+00:00 app[worker.1]: [2023-11-12 16:28:14] [167 ] [INFO ] Loading users.json
2023-11-12T16:28:14.580749+00:00 app[worker.1]: [2023-11-12 16:28:14] [167 ] [INFO ] Loading users.json
2023-11-12T16:28:14.580891+00:00 app[worker.1]: [2023-11-12 16:28:14] [167 ] [INFO ] Loaded json from users.json
2023-11-12T16:28:14.580917+00:00 app[worker.1]: [2023-11-12 16:28:14] [167 ] [INFO ] Loaded json from users.json
2023-11-12T16:28:14.580988+00:00 app[worker.1]: [2023-11-12 16:28:14] [167 ] [INFO ] Saving to users.json
2023-11-12T16:28:14.581019+00:00 app[worker.1]: [2023-11-12 16:28:14] [167 ] [INFO ] Saving to users.json
2023-11-12T16:28:14.581440+00:00 app[worker.1]: [2023-11-12 16:28:14] [167 ] [INFO ] Initializing Bing ImageGen module with proxy # my proxy #
2023-11-12T16:28:14.581480+00:00 app[worker.1]: [2023-11-12 16:28:14] [167 ] [INFO ] Initializing Bing ImageGen module with proxy # my proxy #
2023-11-12T16:28:14.581727+00:00 app[worker.1]: [2023-11-12 16:28:14] [167 ] [WARNING ] No EdgeGPT_cookies.json file! Returning empty json
2023-11-12T16:28:14.581752+00:00 app[worker.1]: [2023-11-12 16:28:14] [167 ] [WARNING ] No EdgeGPT_cookies.json file! Returning empty json
2023-11-12T16:28:14.964673+00:00 app[worker.1]: [2023-11-12 16:28:14] [167 ] [WARNING ] Error sending reply with escape_mode 0: Can't parse entities:
character '!' is reserved and must be escaped with the preceding '' You can ignore this message
2023-11-12T16:28:14.965690+00:00 app[worker.1]: [2023-11-12 16:28:14] [167 ] [WARNING ] Error sending reply with escape_mode 0: Can't parse entities:
character '!' is reserved and must be escaped with the preceding '' You can ignore this message
2023-11-12T16:28:15.488642+00:00 app[worker.1]: [2023-11-12 16:28:15] [167 ] [ERROR ] Error processing request!
2023-11-12T16:28:15.488652+00:00 app[worker.1]: Traceback (most recent call last):
2023-11-12T16:28:15.488654+00:00 app[worker.1]: File "/app/QueueHandler.py", line 372, in request_processor
2023-11-12T16:28:15.488655+00:00 app[worker.1]: bing_image_gen_module.initialize(proxy
)
2023-11-12T16:28:15.488655+00:00 app[worker.1]: File "/app/BingImageGenModule.py", line 100, in initialize
2023-11-12T16:28:15.488656+00:00 app[worker.1]: raise e
2023-11-12T16:28:15.488656+00:00 app[worker.1]: File "/app/BingImageGenModule.py", line 81, in initialize
2023-11-12T16:28:15.488657+00:00 app[worker.1]: raise e
2023-11-12T16:28:15.488657+00:00 app[worker.1]: File "/app/BingImageGenModule.py", line 70, in initialize
2023-11-12T16:28:15.488657+00:00 app[worker.1]: raise Exception("Error reading bing cookies!")
2023-11-12T16:28:15.488658+00:00 app[worker.1]: Exception: Error reading bing cookies!
2023-11-12T16:28:15.488687+00:00 app[worker.1]: [2023-11-12 16:28:15] [167 ] [ERROR ] Error processing request!
2023-11-12T16:28:15.488687+00:00 app[worker.1]: Traceback (most recent call last):
2023-11-12T16:28:15.488688+00:00 app[worker.1]: File "/app/QueueHandler.py", line 372, in request_processor
2023-11-12T16:28:15.488688+00:00 app[worker.1]: bing_image_gen_module.initialize(proxy
)
2023-11-12T16:28:15.488688+00:00 app[worker.1]: File "/app/BingImageGenModule.py", line 100, in initialize
2023-11-12T16:28:15.488688+00:00 app[worker.1]: raise e
2023-11-12T16:28:15.488688+00:00 app[worker.1]: File "/app/BingImageGenModule.py", line 81, in initialize
2023-11-12T16:28:15.488689+00:00 app[worker.1]: raise e
2023-11-12T16:28:15.488689+00:00 app[worker.1]: File "/app/BingImageGenModule.py", line 70, in initialize
2023-11-12T16:28:15.488689+00:00 app[worker.1]: raise Exception("Error reading bing cookies!")
2023-11-12T16:28:15.488689+00:00 app[worker.1]: Exception: Error reading bing cookies!
2023-11-12T16:28:15.580256+00:00 app[worker.1]: [2023-11-12 16:28:15] [2 ] [INFO ] Trying to kill process with PID 167
2023-11-12T16:28:15.580505+00:00 app[worker.1]: [2023-11-12 16:28:15] [2 ] [INFO ] Killed? True
2023-11-12T16:28:15.580674+00:00 app[worker.1]: [2023-11-12 16:28:15] [2 ] [INFO ] Container with id 1502570232 (PID 167) was removed from the qu"

Issues

It is not an important issue or feature i don't know but what is this numbers in the bing module as shown in the image I have circled that with red color.
Screenshot_20231119_122125_Telegram

How to deply this on zeabur

I have tried to deply this on zeabur and add the values on the config.json file but it not work the I try the get the environmental Variable but I did not understand how can I add the env's as is has no env file how to add the values in the zeabur or any hosting providers environmental Variable.

export chat

the ability to export chat or message/conversation

I did not understand

I did not understand the edge gpt in config.json I have to add a file called config.json or I do not change anything in edgegpt settings I have to add a cookie.json

Empty response after bot commands

2023-05-26 10:05:46 MainThread INFO     logging setup is complete
2023-05-26 10:05:46 MainThread INFO     Loading messages.json
2023-05-26 10:05:46 MainThread INFO     Loaded json from messages.json
2023-05-26 10:05:46 MainThread INFO     Initializing ChatGPT module with API type 3
revChatGPT/__init__.py:29: UserWarning: The current Python is not a recommended version, 3.10+ is recommended
2023-05-26 10:05:48 MainThread INFO     ChatGPT module initialized
2023-05-26 10:05:48 MainThread WARNING  DALL-E module disabled in config file!
2023-05-26 10:05:48 MainThread WARNING  EdgeGPT module disabled in config file!
2023-05-26 10:05:48 MainThread WARNING  Bard module disabled in config file!
2023-05-26 10:05:48 Thread-1 INFO     Starting queue_processing_loop
2023-05-26 10:05:48 MainThread INFO     queue_processing_loop thread: Thread-1
2023-05-26 10:05:48 Thread-2 INFO     Starting response_loop
2023-05-26 10:05:48 MainThread INFO     response_loop thread: Thread-2
2023-05-26 10:05:48 MainThread INFO     Starting telegram bot
telegram/ext/_applicationbuilder.py:303: PTBUserWarning: `Application` instances should be built via the `ApplicationBuilder`.
2023-05-26 10:05:48 MainThread INFO     HTTP Request: POST https://api.telegram.org/botxxxxxxxxxxx/getMe "HTTP/1.1 200 OK"
2023-05-26 10:05:48 MainThread INFO     HTTP Request: POST https://api.telegram.org/botxxxxxxxxxxx/deleteWebhook "HTTP/1.1 200 OK"
2023-05-26 10:05:48 MainThread INFO     Application started
2023-05-26 10:05:59 MainThread INFO     HTTP Request: POST https://api.telegram.org/botxxxxxxxxxxx/getUpdates "HTTP/1.1 200 OK"

Plus: Python version in Dockerfile is still 3.9

Chatgpt Not working

Screenshot_20231203_102534_Telegram
I have tried but I could not use the chatgpt api type 1 I tried to host the chatgpt proxy but it not work please guide me to use chatgpt api type 1.

write the number of messages

the feature of writing the number of conversation messages under the messages for bing or on the button, such as 10/30

bard cookies is working about 20 min

bard cookies is working about 20 min and then you get error:

SNlM0e value not found. Double-check __Secure-1PSID value or pass it as token='xxxxx'.

will be great if you can apply cookie rotation mechanism or using multi-cookies and try next one by dictonary array when old one stop working

NotImplementedError

Hi! I apologize in advance if my questions are too noob. This looks like a wonderful project, but I'm having trouble getting it to run. I'm getting an error after starting it up, in the QueueHandler

Traceback (most recent call last):
File "xxxx/GPT-Telegramus/QueueHandler.py", line 450, in _queue_processing_loop
if self.request_response_queue.qsize() == 0:
File "xxxx/.pyenv/versions/3.10.12/lib/python3.10/multiprocessing/queues.py", line 126, in qsize
return self._maxsize - self._sem._semlock._get_value()
NotImplementedError

Am I missing something in the configuration file or missed installing some requirements? As you can see I'm running 3.10.12 installed using pyenv. I'm trying to run this on a Mac M1.

Bot don't reacts on anything.

Hello,

I have installed the bot and configured. Then started... It's looks like there are no problems... log is ok. But nothing happens if I write to the bot...

Can you Help me, please?

Bing Ai / Edge Gpt capchta error

"Exception: CaptchaChallenge: User needs to solve CAPTCHA to continue." Is there an easy way to solve the captcha error? Or do we have to do this with capchta solver services?

not running 24/7

I'm deploying this bot in replit (cause it's free)
And it's running well and your bot is great.. But it stops after sometime.. Please fix code to deploy a webpage with it so i can ping it. Thank you.

Not work without any errors

Install with command:

pip3.9 install -r requirements.txt --upgrade

and the setting.json is configured accordingly.

Then, I run it using command "python3.9 main.py", and the output is below without any errors:

2023-03-03 03:26:30 INFO     Proxy checks disabled. Initializing chatbot...
2023-03-03 03:26:30 INFO     AIHandler thread: Thread-1
2023-03-03 03:26:30 INFO     Responses handler background thread: Thread-2
2023-03-03 03:26:31 INFO     Application started

However, the telegram bot does not work without any responses.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.