Skip to content

Commit

Permalink
Merge pull request #24 from F33RNI/next
Browse files Browse the repository at this point in the history
Next
  • Loading branch information
F33RNI authored May 5, 2023
2 parents e578cc8 + 47c3f34 commit 9b40fa8
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 50 deletions.
2 changes: 1 addition & 1 deletion BotHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ async def bot_command_or_message_request(self, request_type: int,
if self.config["telegram"]["show_queue_message"]:
await _send_safe(user["user_id"],
self.messages["queue_accepted"].format(
RequestResponseContainer.REQUEST_NAMES[request_type],
self.messages["modules"][request_type],
len(self.queue_handler.get_queue_list()),
self.config["telegram"]["queue_max"]), context)

Expand Down
71 changes: 38 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# GPT-Telegramus
# 🤖 GPT-Telegramus
## ChatGPT, EdgeGPT, DALL-E and Bard implementation as a telegram bot with admin control and automatic proxy searcher
<div style="width:100%;text-align:center;">
<p align="center">
Expand All @@ -17,6 +17,10 @@
<p align="center">
<img src="Screenshots/help.png" width="auto" height="300" alt="/help command">
<img src="Screenshots/chatgpt.png" width="auto" height="300" alt="Screenshot of request to ChatGPT">
</p>
</div>
<div style="width:100%;text-align:center;">
<p align="center">
<img src="Screenshots/edgegpt.png" width="auto" height="300" alt="Screenshot of request to EdgeGPT">
<img src="Screenshots/dalle.png" width="auto" height="300" alt="Screenshot of request to DALL-E">
<img src="Screenshots/bard.png" width="auto" height="300" alt="Screenshot of request to Bard">
Expand All @@ -25,16 +29,16 @@

----------

## Support project
## 😋 Support project

Support the project by buying and listening to my music 🎵

- [Bandcamp](https://f3rni.bandcamp.com)
- [SoundCloud](https://soundcloud.com/f3rni)
- 🟦 [Bandcamp](https://f3rni.bandcamp.com)
- 🟧 [SoundCloud](https://soundcloud.com/f3rni)

----------

## Dependencies
## 📙 Dependencies

- **ChatGPT** (ChatGPT by OpenAI): https://chat.openai.com/chat
- **EdgeGPT** (EdgeGPT by Microsoft): https://bing.com/chat
Expand All @@ -47,7 +51,7 @@ Support the project by buying and listening to my music 🎵

----------

## Get started
## Get started

1. Install Python and pip
2. Download source code
Expand All @@ -60,15 +64,15 @@ Support the project by buying and listening to my music 🎵

----------

## Bot messages
## 💬 Bot messages

You can edit telegram bot messages by editing file `messages.json`. You can add new lines by adding `\\n`

Note: make sure you don't delete argumensts `{0}`, `{1}`, ... in message and please restart script to apply changes

----------

## Running as service on linux
## 🐧 Running as service on linux

1. Install Python and pip
2. Clone repo
Expand Down Expand Up @@ -97,7 +101,7 @@ Note: make sure you don't delete argumensts `{0}`, `{1}`, ... in message and ple

----------

## Running in Docker
## 🐋 Running in Docker

**WARNING: not tested**

Expand All @@ -119,7 +123,7 @@ docker run -d -e TELEGRAMUS_SETTINGS_FILE="PATH_TO_config.json" --name gpt-teleg

----------

## Proxy to bypass geo-blocking
## 🌎 Proxy to bypass geo-blocking

It is possible to bypass geo-blocking of ChatGPT, EdgeGPT, DALL-E or Bard. GPT-Telegramus includes automatic proxy-list downloading with periodic checks

Expand All @@ -132,44 +136,45 @@ Sometimes, searching for a proxy can take a long time. If you think that the fou

----------

## Telegram bot commands

- `/start` - Welcome message and bot version
- `/help` - Show this message
- `/chatgpt <request>` - ChatGPT request
- `/edgegpt <request>` - EdgeGPT request
- `/bard <request>` - Bard request
- `/dalle <request>` - Draw a picture with DALL-E
- `/clear <module>` - Clear chat history (chatgpt / edgegpt / bard)
- `/chatid` - Show your chat_id
Or just send a text message

Admin commands:
- `/queue` - Show requests queue
- `/restart` - Restart modules and telegram bot
- `/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
## 🤖 Telegram bot commands

- 📄 `/start` - Welcome message and bot version
- 📙 `/help` - Show this message
- 🤖 `/chatgpt <request>` - ChatGPT request
- 🔵 `/edgegpt <request>` - EdgeGPT request
- 🖥 `/bard <request>` - Bard request
- 🖼 `/dalle <request>` - Draw a picture with DALL-E
- 🧹 `/clear <module>` - Clear chat history (chatgpt / edgegpt / bard)
- 🆔 `/chatid` - Show your chat_id

💬 Or just send a text message to make a request

### Admin commands:
- 💬 `/queue` - Show requests queue
- 🔃 `/restart` - Restart modules and telegram bot
- 👤 `/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

----------

## Chat history
## 📄 Chat history

GPT-Telegramus saves only ChatGPT chat history locally (`"conversations_dir": "conversations"`). Other modules either have a built-in ability to save chat history or do not have the ability to split conversations

----------

## TODO
## 📝 TODO

- Add some free GPT-4 model

----------

## Contribution
## Contribution

- Anyone can contribute! Just create a pull request

----------

## P.S. This project is still under development!
### 🚧 P.S. This project is still under development!
Binary file modified Screenshots/bard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Screenshots/chatgpt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Screenshots/dalle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Screenshots/edgegpt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Screenshots/help.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 19 additions & 16 deletions messages.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
{
"start_message": "Hello, choomba!\\n\\nGPT-Telegramus version {0}\\n\\nGPT-Telegramus author: Fern Lane\\nContributors: Sergey Krashevich\\nChatGPT API: acheong08\\nEdgeGPT API: acheong08\\nBard API: acheong08\\n\\nSupport the project by buying my music: https://f3rni.bandcamp.com",
"help_message": "/start - Welcome message and bot version\\n/help - Show this message\\n/chatgpt <request> - ChatGPT request\\n/edgegpt <request> - EdgeGPT request\\n/bard <request> - Bard request\\n/dalle <request> - Draw a picture with DALL-E\\n/clear <module> - Clear chat history (chatgpt / edgegpt / bard)\\n/chatid - Show your chat_id\\n\\nOr just send a text message",
"help_message_admin": "Admin commands:\\n/queue - Show requests queue\\n/restart - Restart modules and telegram bot\\n/users - Show list of all users\\n/ban <id> [reason] - Ban a user by their id with reason (optional)\\n/unban <id> - Unban a user by their id\\n/broadcast <message> - Send text message to everyone except banned users",
"empty_request": "Empty request, choomba!",
"permissions_deny": "You do not have permission for this command!",
"queue_overflow": "Queue is full. Try again later",
"queue_empty": "Queue is empty",
"queue_accepted": "Request to the {0} module\\nAdded to the queue. Position: {1}/{2}",
"response_error": "Error: {0}\\n\\nMake another request or try again later =(",
"edgegpt_sources": "[{0}] {1} ({2})\\n",
"start_message": "Hello, \uD83D\uDC4B choomba! \uD83D\uDC4B\\n\\nGPT-Telegramus version \uD83D\uDCC4 {0}\\n\\nGPT-Telegramus author: Fern Lane\\nContributors: Sergey Krashevich\\nChatGPT API: acheong08\\nEdgeGPT API: acheong08\\nBard API: acheong08\\n\\nSupport the project by buying my music: https://f3rni.bandcamp.com",
"help_message": "\uD83D\uDCC4 /start - Welcome message and bot version\\n/help - Show this message\\n\uD83E\uDD16 /chatgpt <request> - ChatGPT request\\n\uD83D\uDD35 /edgegpt <request> - EdgeGPT request\\n\uD83D\uDDA5 /bard <request> - Bard request\\n\uD83D\uDDBC /dalle <request> - Draw a picture with DALL-E\\n\uD83E\uDDF9 /clear <module> - Clear chat history (chatgpt / edgegpt / bard)\\n\uD83C\uDD94 /chatid - Show your chat_id\\n\\n\uD83D\uDCAC Or just send a text message",
"help_message_admin": "Admin commands:\\n\\n\uD83D\uDCAC /queue - Show requests queue\\n\uD83D\uDD03 /restart - Restart modules and telegram bot\\n\uD83D\uDC64 /users - Show list of all users\\n\uD83D\uDD28 /ban <id> [reason] - Ban a user by their id with reason (optional)\\n\uD83D\uDD13 /unban <id> - Unban a user by their id\\n\uD83D\uDCE2 /broadcast <message> - Send text message to everyone except banned users",
"empty_request": "Empty request, \uD83E\uDD74 choomba!",
"permissions_deny": "You do not have permission for this command! \uD83D\uDD28",
"queue_overflow": "Queue is full. Try again later",
"queue_empty": "Queue is empty \uD83D\uDDD1",
"queue_accepted": "Request to the {0} module\\nAdded to the queue. Position: {1}/{2}",
"response_error": "Error: {0}\\n\\nMake another request or try again later \uD83D\uDE2D",
"edgegpt_sources": "\uD83D\uDCC4 [{0}] {1} ({2})\\n",
"users_admin": "User ID (Name)\\tAdmin?\\tBanned?\\tTotal requests\\n\\n{0}",
"restarting": "Restarting in progress...\\nPlease wait",
"restarting_done": "The restart is completed",
"restarting": "Restarting in progress...\\nPlease wait \uD83D\uDE4F",
"restarting_done": "The restart is completed \uD83C\uDF89",
"chat_cleared": "Chat history cleared for module: {0}",
"clear_no_module": "Specify the module whose chat history you want to clear\\nchatgpt / edgegpt / bard\\nExample: /clear chatgpt",
"ban_message_admin": "Banned user: {0}\\n\\nReason: {1}",
"ban_no_user_id": "Error! Please specify user_id",
"ban_message_user": "You have been banned!\\n\\nReason: {0}",
"ban_reason_default": "Reason not specified. Maybe the whitelist is enabled or you pissed off the admin =)",
"ban_message_user": "You have been banned! \uD83D\uDD28\\n\\nReason: {0}",
"ban_reason_default": "Reason not specified. Maybe the whitelist is enabled or you pissed off the admin \uD83D\uDE02",
"unban_message_admin": "Unbanned user: {0}",
"broadcast_no_message": "No message to broadcast!",
"broadcast": "[GPT-TELEGRAMUS]\\n\\n{0}"
}
"broadcast": "\uD83D\uDCE2 GPT-TELEGRAMUS \uD83D\uDCE2\\n\\n{0}",
"modules": [
"\uD83E\uDD16 ChatGPT", "\uD83D\uDDBC DALL-E", "\uD83D\uDD35 EdgeGPT", "\uD83D\uDDA5 Bard"
]
}

0 comments on commit 9b40fa8

Please sign in to comment.