DEV Community

Sergio Gragera
Sergio Gragera

Posted on

Coding a WhatsApp AI assistant

Have you also forgotten to congratulate a friend on WhatsApp? I do, and I'm not proud of it, but I am capable of solving it.

As a result of this problem I had the idea of schedule in my Google calendar all the birthdays of my friends and thus receiving a notification on the appointed day. However, when the day comes, I am able to read the notification but postpone sending that message or call and forget for the rest of the day that this task was pending.

I usually use WhatsApp to congratulate my contacts, so one day I decided to integrate all this so that when the time comes it is sent automatically. Well, that project had a problem and it was that I had to write the different messages, each and every one of them, if I didn't want all my friends to receive the same congratulations. But artificial intelligence knows how to generate messages, so it had a solution to everything: remember the day, generate a personalized greeting and send it automatically.

schedule a event in google calendar

delivered automatic message

This is how I created this open source project where given an event with the subject "Write a birthday message for my friend Peter" and when the day of the event arrives, it is processed by an artificial intelligence that composes a message like "Happy birthday Peter! I wish you a day full of joy, love and laughter..." and is sent by WhatsApp to the contact or list of contacts assigned to the event. If one day I want to send a specific message, I just have to write it in the description and nothing will be generated automatically. That message will just be sent.

start script command

We have an assistant on WhatsApp scheduled from a calendar! Next steps? Well, in the roadmap I have to process the messages that arrive in my personal chat (the one that I keep with myself) and respond with the generated message, thus creating a personal assistant. I think with a few more lines I could transcribe the audio message to text to create a more natural user interface and even output the response as audio so I can speak and listen directly to the assistant. I hope you like it!

Top comments (0)