-
-
Save sidouglas/e7b211f175579dc3306a2e046fd8cc4e to your computer and use it in GitHub Desktop.
Slack API set status curl command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
now=$(date +%s) | |
oneHour=$(($now + 3600)) | |
curl 'https://slack.com/api/users.profile.set' \ | |
--header 'Authorization: Bearer YOUR_TOKEN' \ | |
--header 'Content-Type: application/json' \ | |
--data-raw "{ | |
\"profile\": { | |
\"status_text\": \"On Lunch\", | |
\"status_emoji\": \":hamburger:\", | |
\"status_expiration\": $oneHour | |
} | |
}" | |
curl 'https://slack.com/api/users.setPresence' \ | |
--header 'Authorization: Bearer YOUR_TOKEN' \ | |
--header 'Content-Type: application/json' \ | |
--data-raw "{ \"presence\": \"away\" }" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the write up — I found you on Reddit. I had to update the old token today...
https://www.jeroendruwe.be/automated-slack-lunch-status/