- Telegraf.js : https://telegraf.js.org/
- Google Gemini Model
- Mongoose (ODM by MongoDB).
- React (Yet to build MiniApps for the same. )
-
User Model : userModel - Name , id etc data of users
-
Task Model : Specific user's tasks stored in tasks Model.
-
Goto api/webhook.js On starting the bot , user's data is available to us through ctx or context provided by
telegraf.js
we store that data in user model. -
There's commands and actions for the particular commands , go through code you'll understand it easily
Example
: On Sending a random message the bot with perfom actions defined (in our case it'll reply with a message and sticker)
- Code for Gemini interaction : click here
- Simply take text as input
- Store that text in tasks model .
getAllTasks
to get all tasks.
-
First Biggest optimisation we can do is (by providing/ maintaining context) of a specific user / chat History.(that must retain for a user for a particular time)
-
User can subsribe to contest notifications :
- One can scrap data from https://clist.by/ and notify user's about some of the most popular constasts 1hr or 1 day before the contest begins. with proper links.
-
Help user Track their progress : Provides a summary of user's tasks/data or coding profiles
-
Using MiniApps (by react) : For an improved UI/UX.
-
Writing Content :
- Get command as
/idid something
, and store it on some ididDB (mongoDB ) - Now after users send
/summarizeMyDay
Command: Based on that data generate content for linkedin / twitter or other social media apps. (can use gemini for same).
- Help us brainStorm more ideas ! More features that'll make it a really useful thing rather than just a gemini wrapper.
(use the power of coding - infinite api's already written there , infinite no. of possibilites. )
Let's do it !!! LFG 🚀🚀🚀🚀🚀
1 git clone https://github.com/nerdyabhi/telegram-bot-nodejs
-
Write
npm i
command and install all the dependencies -
Create a
.env
file and add your corresponding API's
TELEGRAM_BOT_API = xxx-xx-xx
MONGO_URL = xxx-xxx-xxx
GROQ_API = xxx-xxx-xxx
GEMINI_API = xxx-xx-xx
npm run dev
and voila !!
- Made with 💖 by [Nerdy Community]