Adding Slack modules
This commit is contained in:
58
modules.example.yaml
Normal file
58
modules.example.yaml
Normal file
@@ -0,0 +1,58 @@
|
||||
# Example modules.yaml — copy to ~/.config/streamdeck-go/modules.yaml
|
||||
#
|
||||
# Required Slack token scopes: users.profile:write, users:write, dnd:write
|
||||
# Export your token: export SLACK_TOKEN="xoxp-..."
|
||||
|
||||
modules:
|
||||
slack:
|
||||
set_status:
|
||||
params:
|
||||
emoji: ":speech_balloon:"
|
||||
text: "In a meeting"
|
||||
expiry: "1h"
|
||||
exec: |
|
||||
curl -s -X POST https://slack.com/api/users.profile.set \
|
||||
-H "Authorization: Bearer {{env "SLACK_TOKEN"}}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"profile":{"status_emoji":"{{.emoji}}","status_text":"{{.text}}","status_expiration":{{expiry .expiry}}}}'
|
||||
|
||||
clear_status:
|
||||
exec: |
|
||||
curl -s -X POST https://slack.com/api/users.profile.set \
|
||||
-H "Authorization: Bearer {{env "SLACK_TOKEN"}}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"profile":{"status_emoji":"","status_text":"","status_expiration":0}}'
|
||||
|
||||
set_presence:
|
||||
params:
|
||||
presence: "away"
|
||||
exec: |
|
||||
curl -s -X POST https://slack.com/api/users.setPresence \
|
||||
-H "Authorization: Bearer {{env "SLACK_TOKEN"}}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"presence":"{{.presence}}"}'
|
||||
|
||||
snooze:
|
||||
params:
|
||||
minutes: "60"
|
||||
exec: |
|
||||
curl -s -X POST https://slack.com/api/dnd.setSnooze \
|
||||
-H "Authorization: Bearer {{env "SLACK_TOKEN"}}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"num_minutes":{{.minutes}}}'
|
||||
|
||||
go_offline:
|
||||
exec: |
|
||||
curl -s -X POST https://slack.com/api/users.setPresence \
|
||||
-H "Authorization: Bearer {{env "SLACK_TOKEN"}}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"presence":"away"}' && \
|
||||
curl -s -X POST https://slack.com/api/users.profile.set \
|
||||
-H "Authorization: Bearer {{env "SLACK_TOKEN"}}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"profile":{"status_emoji":"","status_text":"","status_expiration":0}}'
|
||||
|
||||
end_snooze:
|
||||
exec: |
|
||||
curl -s -X POST https://slack.com/api/dnd.endSnooze \
|
||||
-H "Authorization: Bearer {{env "SLACK_TOKEN"}}"
|
||||
Reference in New Issue
Block a user