A Node.js-based Telegram bot powered by OpenAI that provides simple and inventive answers to your questions.
Username: @Ektra_OpenAI_Bot
-
node-telegram-bot-api : It is Node.js module to interact with the official Telegram Bot API.
-
Airtable : Airtable is an easy-to-use online platform for creating and sharing relational databases. It is a spreadsheet-database hybrid which lets you create powerful databases that can be used to power custom applications. Airtable has two APIs:
-
Railway : Railway is a platform for deployment where you can set up infrastructure, work with it locally, and then deploy to the cloud.
-
OpenAI GPT-3 : GPT-3, created by OpenAI, is a machine learning model specialising on language processing. GPT-3 generates new text from an input text. Depending on the input and the precise flavour of GPT-3 applied, the output text will conform to a job like as responding to a question stated in the input or finishing the input with additional information.
- Send @BotFather a
/newbot
message - Pick name and username.
- Receive a BOT_TOKEN
B. Airtable REST API
- Create an account on Airtable.
- Go to your account page
- Under API heading in Account Overview page, click Generate API key button.
C. OpenAI
- Create an account on OpenAI
- Go to your account page
- Under User heading, go to API keys and click Create new secret Key
After getting all the API keys. Follow these steps:
- Git clone or download this repository
git clone https://github.com/vruksheco/Ekatra-QnA-Bot.git
cd Ekatra-QnA-Bot
- Install all dependencies
npm install
- Rename .env_example file into .env and set
- TOKEN to your telegram bot API key
- apiKey to your OpenAI key
- airtable_api to your Airtable REST API key.
- Set up and connect MongoDB environment of your choice
- Run
npm start
- Create a github repository for the bot.
- Sign up or login to your railway.app account
- Create a new project and select Deploy from GitHub repo > Configure Github app and link your bot github repository.
- Once the project starts deploying, go to variables and add the environment variables.
- Create a new service and select Provision Mongo db
The bot is up and running. (If not - check Railway Deploy logs)
Follow Telegram Bot API for latest updates.
Share your bot on Store Bot
Reference:
If you have any suggestion on how to improve the code create a PR request or faced any issues feel free to contact me.
👤 Ramsha Shaikh
- Github: @ramshashaikh
Give a ⭐️ if this project helped you!