Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
198 lines (192 sloc) 5.09 KB
omg: 1
lifecycle:
startup:
command: ["node", "app.js"]
actions:
send:
help: |
Post a message in a channel or thread.
http://slackapi.github.io/node-slack-sdk/web_api#posting-a-message
arguments:
text:
type: string
in: requestBody
required: true
help: Text of the message to send.
to:
type: string
in: requestBody
help: |
What channel to send message in.
This can be a "#channel" "@user" or a channel id.
attachments:
type: list
in: requestBody
# items:
# type: map
# attributes:
# fallback:
# help: Required plain-text summary of the attachment.
# type: string
# color:
# type: string
# pattern: '^#\\w{6}'
# author_name:
# type: string
# author_link:
# type: string
# pattern: '^http'
# author_icon:
# type: string
# pattern: '^http'
# title:
# type: string
# title_link:
# type: string
# pattern: '^http'
# text:
# type: string
# help: Optional text that appears within the attachment
# fields:
# type: list
# items:
# type: map
# properties:
# title:
# type: string
# value:
# type: string
# short:
# type: boolean
# image_url:
# type: string
# pattern: '^http'
# thumb_url:
# type: string
# pattern: '^http'
# footer:
# type: string
# footer_icon:
# type: string
# pattern: '^http'
# ts:
# type: int
output:
type: map
http:
contentType: application/json
port: 5000
method: post
path: /send
bot:
help: Start a Slack bot
events:
hears:
help: Triggered anytime a messages matches the pattern
arguments:
pattern:
type: string
in: requestBody
help: A regexp pattern to filter messages
channel:
type: string
in: requestBody
required: true
help: Only listen in a specific channel
http:
port: 5000
subscribe:
method: post
path: /subscribe
contentType: application/json
unsubscribe:
path: /unsubscribe
method: post
output: &output
contentType: application/json
type: object
properties:
text:
help: The message text
type: string
client_msg_id:
help: The message ID
type: string
channel:
help: The channel ID
type: string
user:
help: The user ID
type: string
ts:
help: The message timestamp (eg: "1535474523.000100")
type: string
# actions:
# reply:
# help: Reply to the message
# arguments:
# text:
# type: string
# in: requestBody
# required: true
# help: Text of the message to send.
# http:
# contentType: application/json
# port: 5000
# method: post
# path: /send
responds:
help: Triggered by direct messages to the bot
http:
subscribe:
contentType: application/json
port: 5000
method: post
path: /subscribe
arguments:
pattern:
type: string
in: requestBody
help: A regexp pattern to filter messages
output:
<<: *output
channels:
help: Get a list of channels
http:
port: 5000
method: post
path: /channels
arguments:
limit:
type: int
default: 100
in: requestBody
help: Limit the number of channels to return. Must be less than 1000.
exclude_archived:
type: boolean
default: false
in: requestBody
help: Set to true to exclude archived channels from the list
types:
type: list
in: requestBody
help: |
Mix and match channel types: public_channel, private_channel, mpim, im
Default is public_channel only.
output:
contentType: application/json
type: list
items:
type: object
properties:
id:
help: The channel ID
type: string
name:
help: The channel name
type: string
environment:
BOT_TOKEN:
required: true
type: string
help: The Slack bot token