Open comments for this post
caching! right now we have a 5 minute TTL, which is often enough to catch new pictures quickly but slow enough to stay (well) within ratelimits. also enrolled channels will receive their daily photo at 12 noon in the America/New_York timezone. also also it will retry api requests if they fail cuz the APOD api is kinda sketchy…..
Open comments for this post
now whenever someone runs /apod they get a (empheral) prompt to enroll the channel so it gets pictures daily. this adds the channel id to a SQLite table. there’s also a option to not be prompted to do this again. right now enrolling a channel doesn’t actually result in getting pictures daily, but i’m planning on using node-cron to set that up.
Open comments for this post
the bot now replies to the message with the explanation as posted by nasa.
Open comments for this post
now when you run /apod (or ping the bot) you get todays APOD. it also has the title of the picture and a button to open the full res version in your browser
Open comments for this post
Basic slackbot setup. Now when you run /apod or ping the bot user it’ll respond with a picture from lorum picsum.