This Telegram bot allows you to interact with the GPT-4 and Gemini Advance APIs from RapidAPI. Follow the steps below to get started and learn how to use the bot effectively.
- Node.js installed
- A MongoDB instance (local or cloud)
- A RapidAPI account with access to the GPT-4 and Gemini Advance APIs
- A Telegram Bot Token from BotFather
Create a .env
file in the root directory of your project and add the following environment variables:
BOT_TOKEN=your-telegram-bot-token
MONGODB_URI=your-mongodb-uri
Run the following command to install the required dependencies:
npm install telegraf mongoose axios dotenv
Start the bot by running:
node index.js
Starts the bot and provides a welcome message with detailed usage instructions.
Welcome to the AI Bot! Follow these steps to get started:
1. Subscribe to the API from RapidAPI:
https://rapidapi.com/yashdoneria/api/gpt-4-and-gemini-advance/
2. Save your API key using the /save command:
/save YOUR_API_KEY
Note: You can only save or update your API key up to 3 times.
3. Use the following commands to interact with the bot:
/gemini {your prompt}
/gpt {your prompt}
Examples:
/gemini Tell me a joke
/gpt What is the capital of France?
If you encounter any issues, please ensure your API key is valid and you haven't exceeded your daily limit.
Displays the same usage instructions as the /start
command.
Saves your RapidAPI key. You can save or update your API key up to 3 times.
/save YOUR_API_KEY
If you exceed the limit, you will be notified and won't be able to save a new key.
Sends a prompt to the Gemini Advance API and returns the response.
/gemini Tell me a joke
Sends a prompt to the GPT-4 API and returns the response.
/gpt What is the capital of France?
- If you provide an invalid API key or exceed your daily limit, you will receive a message indicating the issue.
- If any errors occur during API requests, you will be notified to try again.
I'm a powerful AI model with a massive context window, a flair for creative collaboration, and exclusive features to supercharge your logical reasoning and coding skills. Want to explore 1500 pages of information or get up-to-date search snippets? I'm your bot. 😉
Oh sure, because sarcasm is definitely the most effective way to prove my capabilities. Just what I always wanted to showcase my advanced artificial intelligence skills.
If you encounter any issues:
- Ensure your API key is valid.
- Check if you have exceeded your daily limit.
- Verify your MongoDB connection.
- Make sure your environment variables are correctly set up.
For further assistance, refer to the documentation of the respective libraries and APIs you are using.
To subscribe to the GPT-4 and Gemini Advance APIs, visit the following link: RapidAPI GPT-4 and Gemini Advance API