TelegramGPTBot is a Telegram bot built with Node.js and Telegraf that allows users to generate text, images and transcribe audio or video using OpenAI's GPT-3, DALL-E and Whisper models.
Generate images using Dall-e Generate text using GPT-3 Transcribe audio or video using OpenAI's speech recognition API(Whisper). Supports multiple languages
- Clone the repository:
git clone https://github.com/sky10p/TelegramGPTBot.git
- Install dependencies
yarn install
- Create a '.env' file with your Telegram bot token, Open AI Api key and other configuration variables:
TELEGRAM_BOT=your_bot_token_here
OPEN_AI_TOKEN=your_open_api_key_here
ALLOWED_USERS=allowed_users_telegram_ids
- Start the bot: yarn start
Create your bot to use these code and get the key, you can add the actions to make easier work with it
- help - Request assistance on how to use the bot
- chat - Start a conversation with TelegramGPT
- generation_image - Generate an image
- transcript - Transcribe an audio or video
- summarize - Summarize a text
- key_points - Return the most important points of a text
- improve - Enhance the quality of a text (more accurately explained)
- commit - Generate a commit command and its description based on your text
- usage_day - Price per day
- usage_month - Price per month
- settings - Change the GPT model
- current_model - View the active GPT model in use
- cancel - Cancel the current operation.
To use the bot, you need to create your own Telegram bot first. You can follow the instructions on Telegram's Bot FAQ to create your own bot. Once you have created your bot, you can add the commands that are available in the doc/actions.txt file to your bot's commands list.
After that, you need to set your Telegram bot token and OpenAI API key in the .env file. Once you have done that, you can start the bot with the command yarn start.
The ChatGpt bot can also be used through Telegram inline queries. To use this feature, you need to activate inline mode for your bot using BotFather.
Once inline mode is activated, you can perform the following actions in a chat with someone else:
- Ask ChatGPT a question or about you want to.
- Translates text to English.
- Translates text to Spanish.
- Generate an image.
To use these features, simply start typing a message to the person you want to chat with, and include the "@" symbol followed by the name of your bot (e.g. "@ChatGPT"). This will bring up a menu with the four options listed above. Choose the action you want to perform and the type in the text you want to use. The bot will then generate a response based on your selected action and prompt.
- Improving the prompt for image generation: The current prompt for image generation can be improved before generating the image.
Contributions are welcome! If you want to contribute to this project, please follow these steps:
- Fork this repository.
- Create a new branch with your feature or bug fix.
- Commit your changes and push the branch to your forked repository.
- Create a pull request to this repository.
This project is licensed under the GNU General Public License v3.0. You can find more information in the LICENSE file.
Use the /generation_image command to generate an image using DALL-E. Follow the bot's instructions to specify the image you want to generate.
Use the /generation_image command to generate an image using DALL-E. Follow the bot's instructions to specify the image you want to generate.
Use the /chat command to start a conversation with the bot. The bot will ask you what you want to talk about. Type your response and let the bot generate a response.
Use the /summarize command to summarize a text. Follow the bot's instructions to specify the text you want to summarize.
Use the /key_points command to get the key points of a text. Follow the bot's instructions to specify the text you want to get the key points of.
Use the /improve command to improve the quality of a text. Follow the bot's instructions to specify the text you want to improve.
Use the /transcript command to transcribe an audio or video file. Follow the bot's instructions to specify the file you want to transcribe.
If the result text is greater than allowed of 4096, it will be sended as a file.
Use the /usage_day or /usage_month command to get pricing information.