This Telegram bot integrates user-provided OpenAI GPT-3.5 and GPT-4 API keys, offering enhanced conversational capabilities and additional features through specialized Telegram commands, leveraging advanced language models for an enriched chatbot experience.
Utilize your own API key for a personalized and seamless integration experience with our chatbot. It comes packed with a variety of functionalities that enhance your interactions. You can activate specific features directly within Telegram using these commands:
/read - Extracts and reads the content of the provided URL, delivering the main information straight to your chat.
/google - Conducts a Google search with the specified query and presents you with the top results.
/youtube - Retrieves the transcripts of a selected YouTube video for quick and easy text reference.
/dalle - Leverages OpenAI's DALL-E model to generate imaginative and relevant images based on your prompt.
Newly Added Features:
-
File Summarization:
- Send a PDF file to the chatbot to receive a concise summary of the content, enabling you to grasp the essence of the document without reading it in its entirety.
-
Voice Interaction:
- Engage with the chatbot using voice messages. Simply send a voice command or query, and the bot will respond with an audible voice message, making the interaction more dynamic and accessible.
By incorporating these new capabilities, our chatbot becomes even more versatile and user-friendly, enriching your Telegram experience.
-
Open the Telegram app on your device.
-
Search for the HashGPT bot by entering its username
@HashGPTBot
. Select the bot from the search results. -
Open a chat with the bot by clicking on its name.
-
Start interacting with the bot by sending messages. You can type
/help
in the chat with the bot and the bot will provide you with a list of supported commands and their functionalities.
-
Visit your OpenAI's API Keys page.
-
Provide your API KEY using
/api_key <your-api-key>
command. Make sure to replace<your-api-key>
with your actual API key obtained from OpenAI's API Keys page. -
You can start using HashGPT bot with GPT-3.5 and GPT-4 models.
-
The standard configuration employs the GPT-3.5 model. If you wish to activate the GPT-4 model, please use the command
/gpt4 gpt-4
. Conversely, to revert to the GPT-3.5 model, the appropriate command is/gpt3 gpt-3.5
.
If you prefer a personalized bot, this section guides you on setting up your own chatbot on a local machine using this Django repository.
- Python 3.6 or higher installed on your local machine.
- Telegram account and basic knowledge of bot creation through BotFather.
- OpenAI API key from your OpenAI account.
-
Clone the Repository:
- Use
git clone https://github.com/sazaktechs/hashgpt-telegrambot.git
to clone the project repository to your local machine.
- Use
-
Set Up a Virtual Environment:
- Navigate to the cloned directory.
- Run
python3 -m venv venv
to create a virtual environment. - Activate it by running
source venv/bin/activate
(Unix) or.\venv\Scripts\activate
(Windows).
-
Install Dependencies:
- Inside the activated virtual environment, install the necessary packages with
pip install -r requirements.txt
.
- Inside the activated virtual environment, install the necessary packages with
-
Telegram Bot Creation:
- Create a new Telegram bot via BotFather and obtain the associated token.
-
Environment Variables:
-
To configure the project with your unique credentials, create a
.env
file in the root directory of the project. In this file, you will specify your Telegram Bot Token and OpenAI API key. Here is an example of what the contents of your.env
file should look like:TOKEN=<your_telegram_bot_token> API_KEY=<your_openai_api_key>
-
-
Start the Django Development Server:
- Launch your server using
python manage.py runserver
.
- Launch your server using
-
Webhook Setup:
- Set a webhook by using the Local Bot API Server to point new messages to your local development server.
-
Interact with Your Bot:
- Open Telegram and start a conversation with your newly created bot.
Have ideas for how HashGPT can be improved? Feel free to open an issue or a pull request!
This project is licensed under the MIT License. For more details, see the LICENSE file.