misterjacko / philanthropy-watch

Social bot that broadcasts the causes that the super-rich are not donating to
0 stars 0 forks source link

feat: Accomodate API #6

Open misterjacko opened 1 year ago

misterjacko commented 1 year ago

Resolves #4

When invoking the Lambda Function, Cloudwatch Events passes the "event" json object into the lambda handler which contains a key:value pair of {"source":"aws.events"}.

This change takes advantage of that to only send the tweet when invoked by the scheduled event. Otherwise, it will respond with a json object carrying the message. This will allow users to hit an api endpoint (that will be made in the infra repo) and receive a "random" response.