Skip to content

Instantly share code, notes, and snippets.

@chloegrace94
Created October 2, 2018 15:18
Show Gist options
  • Save chloegrace94/ced7920eb07ccd9fb6a96f6ef0347edd to your computer and use it in GitHub Desktop.
Save chloegrace94/ced7920eb07ccd9fb6a96f6ef0347edd to your computer and use it in GitHub Desktop.
Keep instance up - Slack message with menu attachment
if action_type == "button" and action_value == "keep_up":
message_update = {
"channel":channel_id,
"ts":message_ts,
"text":original_message,
"attachments": [
{
"fallback": ":money_with_wings: Instance *" + str(instance_name) + "* staying up!",
"callback_id": "instance_reminder",
"text": ":heavy_check_mark: Instance *" + str(instance_name) + "* staying up!\nWant to reserve this instance for a while?\nI'll stop asking if you want it brought down... :tada:",
"attachment_type": "default",
"actions": [
{
"name": instance_info,
"text": "Reserve instance for...",
"type": "select",
"options": [
{
"text": "1 Day",
"value": "1"
},
{
"text": "2 Days",
"value": "2"
},
{
"text": "5 Days",
"value": "5"
},
{
"text": "7 Days",
"value": "7"
},
{
"text": "10 Days",
"value": "10"
},
{
"text": "14 Days",
"value": "14"
}
]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment