joaoricardo000 / whatsapp-bot-seed

A small python framework to create a whatsapp bot, with regex-callback message routing.
728 stars 244 forks source link

How to trigger a message based on an external event like time/date? #24

Closed bergonzzi closed 8 years ago

bergonzzi commented 8 years ago

Hi there, first of all thanks a lot for this little framework! It's really helpful to abstract away all the complexity from yowsup. I've forked your repo and have been customizing the hell out of it for my own needs. You might be interested in some features for which I can make a PR, just check out what I have here in my repo (things like movie search using themoviedb.org or weather using openweathermap).

Anyway, I was thinking about another feature that would be nice. I'd like to make the bot send happy birthday automatically to a group by comparing the current date with a pre-defined set of dates.

However I figured that to achieve this I'd have to somehow hook into the main yowsup loop and then check if today's date matches any of the birthdays, every 24h or so. But I have no idea how to do this at the moment so I wonder if you have any.

Thanks!

x23piracy commented 8 years ago

Hi,

yes it would be really nice to have the possibility to trigger a python script or something while the bot is running to tell him send this or that to some contact.

Is this already possible?

Regards X23

joaoricardo000 commented 8 years ago

The method described here also solves this problem! https://github.com/joaoricardo000/whatsapp-bot-seed/issues/23