Merge pull request #37 from github/add_attachment_support
Add support for "attachment" feature
This commit is contained in:
Коммит
1002a1a7fd
|
@ -70,6 +70,7 @@ but it is important that `result` be sufficient on its own.
|
|||
* `image_url`: An image URL to display as the button, will generally take precedence
|
||||
* `command`: The command to use when the button is clicked
|
||||
* `image_url`: An image URL to be included with the response
|
||||
* `attachment`: Optional boolean which hints the recipient to format the message as an attachment, if supported by its protocol. Because this is a hint, it may be ignored by clients. If not specified, it defaults to false.
|
||||
|
||||
CRPC may also produce error JSON according to the JSON-RPC spec, consisting of
|
||||
an object containing an `error` object with a `message` string. This is
|
||||
|
|
|
@ -56,8 +56,13 @@ module Chatops
|
|||
params["params"] || {}
|
||||
end
|
||||
|
||||
def jsonrpc_success(message)
|
||||
jsonrpc_response :result => message.to_s
|
||||
# `options` supports any of the optional fields documented
|
||||
# in the [protocol](../../docs/protocol-description.md).
|
||||
def jsonrpc_success(message, options: {})
|
||||
response = { :result => message.to_s }
|
||||
# do not allow options to override message
|
||||
options.delete(:result)
|
||||
jsonrpc_response response.merge(options)
|
||||
end
|
||||
alias_method :chatop_send, :jsonrpc_success
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче