I wrote about a change that Slack made a few months ago here — it’s about how a recent update introduced a change wherein, setting a Slack status defaults that status expiration to the end of the day. Previously the status expiration was not defined, which means the status wouldn’t disappear at the 0001 hours mark.
I looked at the Slack API and came across this method
users.profile.setwhich indicates an ability to modify an user’s status message, emoji, or the expiration.
I hacked together a single-file app that runs on GitLab CI periodically, to set the expiration to 0.
I have configured GitLab CI to run at 2300 and 2330 using cron. What this means is that, GitLab’s automated runners can now take care of ensuring that my Slack status message does not expire while I am sleeping. 🙂
When I am back at work the next morning at 0530, the status I had set the previous day should be right there.
I used Axios on the app to make the POST requests.
You can see the code below:
The GitLab CI side of things is defined as below: