Skip to content

Kourva/AwesomeChatGPTBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Free ChatGPT Telegram Bot with Multiple Providers support!

No APi-Key | Pre-Defiened Roles | Inline mode | Dan Mode v10



▋Change Log

[Last Status: Apr 21, 2024]: Bot updated!
See more logs here


▋Upcoming Features

  1. Smart reply: Reply to user's message to process them with GPT.
  2. Code generator: Use code generator to generate functions in many languages.
  3. Image generator: Use AI to generate images from prompt.
  4. Voice response: Use Brian voice as your respone (DONE)
  5. Multiple models: Use multiple providers (DONE)
  6. Multiple language: Bot supports multiple languages for better communication. (Idea by chelaxian | Issue)

Multiple Providers

From now bot includes multiple providers (Thanks for gpt4free).
For responding, bot tries all providers one by one to respond and breaks the loop in first valid response. So you don't have to select provider. If non of providers worked, bot will tell you to generate your prompt again.
List of available providers:

  • FakeOpen Ai (uses model ChatGPT 3.5 Turbo)
  • Fstha Chat (uses model ChatGPT 3.5 Turbo)
  • DeepInfra AI (uses model Llama 2 70b Chat hf)
  • Online GPT (uses model ChatGPT 3.5 Turbo)
  • Free GPT 4 (uses ChatGPT 4)
  • GPT 4 Free (uses ChatGPT 4) gpt4free You can send /settings command to bot to change these providers (Enable/Disable)

▋Bot is Down? Not working?

Since bot is supporting multiple providers now, you can use /ping to check which one is working.

Contributions

I welcome contributions. If you've found a reliable solution to this issue or have other useful suggestions, please consider contributing to this project.


▋Features

This bot responds to every message with ChatGPT AI and other models like llama, excluding commands.

  • Inline mode for obtaining predefined roles. How to use
  • The ability to remember chat history.
  • Multiple providers.
  • Voice response.
  • Provider settings (use /settings)

▋Clone Repository

To get started, first you need to clone this repository from github into your machine:

git clone https://github.com/Kourva/AwesomeChatGPTBot

if you dont have git or python you can install it from your package manager!


▋Install Requirements

Then you have to install requirements before running bot

  1. Navigate to bot directory
  2. Install requirements using pip
cd AwesomeChatGPTBot
pip install -r requirements.txt

This will install pyTelegamBotAPI and Requests for you, You can also install them manually if you got any error:

pip install pyTelegamBotAPI Requests

▋Configure your token

Now you have to create bot from BotFather (If you don't have) and get your Token to start working with your bot.
After getting Token from BotFather replace the Token in token.txt

0000000000:AAE7fbH29UPOKzlHlp0YDr9o06o_NdD4DBk

You can use editors like 'nano' or 'vim' in Termux or using echo command to write token to file:

echo "0000000000:AAE7fbH29UPOKzlHlp0YDr9o06o_NdD4DBk" > token.txt

This is just an example Token.


▋Configure the bot commands (Optional)

you can set your bot's commands manually or using 'init.py' script

python init.py

This will set up these commands in bot's menu

  • /start
  • /help
  • /ping
  • /chat
  • /features
  • /history
  • /reset
  • /danmode
  • /tts
  • /settings

▋Launch the bot

Now you are ready to launch your bot in polling mode inside your terminal using python

python main.py

You can also use proxychains to run your bot via Tor proxy

proxycahins python main.py

Or in quiet mode

proxychains -q python main.py

To install proxychains install proxychains-ng and then edit the config file in /etc/proxychains.conf.
It depends on you to use strict_chain or dynamic_chain. Config it by yourself.

▋TOR new IP address

If you got any denied requests that blocked your Ip address, you can renew your IP

sudo killall -HUP tor

And if you want to check your TOR status, use this command:

proxychains curl https://check.torproject.org/api/ip

▋Bot Inline Mode

Don't forget to enable Inline Mode in your bot.
See documentation here: https://core.telegram.org/bots/api#inline-mode


▋Thanks a bunch for starring the project! ⭐

If you have any suggestions or feedback, feel free to share. I appreciate your interest and contribution to the project!

Star History Chart

▋Full Change Log

[Apr 21, 2024] Added gpt4free client which have no issues operating with Cyrillic/Chinese symbols [Mar 14, 2024] Added /settings & /tts commands [Mar 14, 2024] Added voice response

/tts hi

[Mar 14, 2024] Added new chatGPT 4 provider
[Dec 22, 2023] Added Multiple Providers.
[Dec 22, 2023] Added /ping command to ping providers.
[Dec 22, 2023] Removed /setting command and setting files for users.
[Dec 22, 2023] Added more exception handlers for both Connection and Telegram API.
[Dec 01, 2023] Smarter Re-generate: Uses smarter way to re-generate replied question.
[Dec 01, 2023] Settings command: Added setting command to change bot response setting.
[Dec 01, 2023] Added titles.py: To make main code more clear.
[Dec 01, 2023] Error handling: Added more handlers and depp link handlers.
[Nov 13, 2023] PEP8 fixes: Fixed some PEP8 issues.
[Nov 13, 2023] Extra commands: Added help, features and chat commands.
[Nov 13, 2023] MarkdownV2: Added converter to convert regular markdown to Markdown V2.
[Nov 13, 2023] History management: Added utilities to check history and fix it when it got broken.
[Nov 13, 2023] Re-Generate: Users can re-generate their prompts, new answer will be raplaced with old one
[Nov 13, 2023] Improved chat handler: Users now requied to use /chat in groups to chat with bot.

/chat hi

This will avoid mess in replies and even reactions to bot's responses.

[Nov 01, 2023] History command: Added history section added (use /history to get history file)
[Nov 01, 2023] History reset: Added /reset command to reset the chat history.
[Nov 01, 2023] Dan mode v10: Added /danmode** command to enable/disable DAN mode v10.0 in bot.

Note: History will reset when using /danmode command!!

Releases

No releases published

Packages

No packages published

Languages