Module: Slack::Web::Api::Endpoints::Chat
- Included in:
- Slack::Web::Api::Endpoints
- Defined in:
- lib/slack/web/api/endpoints/chat.rb
Instance Method Summary collapse
-
#chat_appendStream(options = {}) ⇒ Object
Appends text to an existing streaming conversation.
-
#chat_command(options = {}) ⇒ Object
Execute a slash command in a public channel (undocumented).
-
#chat_delete(options = {}) ⇒ Object
Deletes a message.
-
#chat_deleteScheduledMessage(options = {}) ⇒ Object
Deletes a pending scheduled message from the queue.
-
#chat_getPermalink(options = {}) ⇒ Object
Retrieve a permalink URL for a specific extant message.
-
#chat_meMessage(options = {}) ⇒ Object
Share a me message into a channel.
-
#chat_postEphemeral(options = {}) ⇒ Object
Sends an ephemeral message to a user in a channel.
-
#chat_postMessage(options = {}) ⇒ Object
Sends a message to a channel.
-
#chat_scheduleMessage(options = {}) ⇒ Object
Schedules a message to be sent to a channel.
-
#chat_startStream(options = {}) ⇒ Object
Starts a new streaming conversation.
-
#chat_stopStream(options = {}) ⇒ Object
Stops a streaming conversation.
-
#chat_unfurl(options = {}) ⇒ Object
Provide custom unfurl behavior for user-posted URLs.
-
#chat_update(options = {}) ⇒ Object
Updates a message.
Instance Method Details
#chat_appendStream(options = {}) ⇒ Object
Appends text to an existing streaming conversation.
20 21 22 23 24 25 26 |
# File 'lib/slack/web/api/endpoints/chat.rb', line 20 def chat_appendStream( = {}) raise ArgumentError, 'Required arguments :channel missing' if [:channel].nil? raise ArgumentError, 'Required arguments :ts missing' if [:ts].nil? raise ArgumentError, 'Required arguments :markdown_text missing' if [:markdown_text].nil? = .merge(channel: conversations_id()['channel']['id']) if [:channel] post('chat.appendStream', ) end |
#chat_command(options = {}) ⇒ Object
Execute a slash command in a public channel (undocumented)
38 39 40 41 42 43 44 |
# File 'lib/slack/web/api/endpoints/chat.rb', line 38 def chat_command( = {}) raise ArgumentError, 'Required arguments :channel missing' if [:channel].nil? raise ArgumentError, 'Required arguments :command missing' if [:command].nil? = .merge(channel: conversations_id()['channel']['id']) if [:channel] logger.warn('The chat.command method is undocumented.') post('chat.command', ) end |
#chat_delete(options = {}) ⇒ Object
Deletes a message.
57 58 59 60 61 62 |
# File 'lib/slack/web/api/endpoints/chat.rb', line 57 def chat_delete( = {}) raise ArgumentError, 'Required arguments :channel missing' if [:channel].nil? raise ArgumentError, 'Required arguments :ts missing' if [:ts].nil? = .merge(channel: conversations_id()['channel']['id']) if [:channel] post('chat.delete', ) end |
#chat_deleteScheduledMessage(options = {}) ⇒ Object
Deletes a pending scheduled message from the queue.
75 76 77 78 79 80 |
# File 'lib/slack/web/api/endpoints/chat.rb', line 75 def chat_deleteScheduledMessage( = {}) raise ArgumentError, 'Required arguments :channel missing' if [:channel].nil? raise ArgumentError, 'Required arguments :scheduled_message_id missing' if [:scheduled_message_id].nil? = .merge(channel: conversations_id()['channel']['id']) if [:channel] post('chat.deleteScheduledMessage', ) end |
#chat_getPermalink(options = {}) ⇒ Object
Retrieve a permalink URL for a specific extant message
91 92 93 94 95 96 |
# File 'lib/slack/web/api/endpoints/chat.rb', line 91 def chat_getPermalink( = {}) raise ArgumentError, 'Required arguments :channel missing' if [:channel].nil? raise ArgumentError, 'Required arguments :message_ts missing' if [:message_ts].nil? = .merge(channel: conversations_id()['channel']['id']) if [:channel] post('chat.getPermalink', ) end |
#chat_meMessage(options = {}) ⇒ Object
Share a me message into a channel.
107 108 109 110 111 |
# File 'lib/slack/web/api/endpoints/chat.rb', line 107 def chat_meMessage( = {}) raise ArgumentError, 'Required arguments :channel missing' if [:channel].nil? raise ArgumentError, 'Required arguments :text missing' if [:text].nil? post('chat.meMessage', ) end |
#chat_postEphemeral(options = {}) ⇒ Object
Sends an ephemeral message to a user in a channel.
144 145 146 147 148 149 150 151 |
# File 'lib/slack/web/api/endpoints/chat.rb', line 144 def chat_postEphemeral( = {}) raise ArgumentError, 'Required arguments :channel missing' if [:channel].nil? raise ArgumentError, 'Required arguments :user missing' if [:user].nil? raise ArgumentError, 'At least one of :attachments, :blocks, :text is required' if [:attachments].nil? && [:blocks].nil? && [:text].nil? = .merge(user: users_id()['user']['id']) if [:user] = (, %i[attachments blocks]) post('chat.postEphemeral', ) end |
#chat_postMessage(options = {}) ⇒ Object
Sends a message to a channel.
194 195 196 197 198 199 |
# File 'lib/slack/web/api/endpoints/chat.rb', line 194 def chat_postMessage( = {}) raise ArgumentError, 'Required arguments :channel missing' if [:channel].nil? raise ArgumentError, 'At least one of :attachments, :blocks, :text is required' if [:attachments].nil? && [:blocks].nil? && [:text].nil? = (, %i[attachments blocks metadata]) post('chat.postMessage', ) end |
#chat_scheduleMessage(options = {}) ⇒ Object
Schedules a message to be sent to a channel.
234 235 236 237 238 239 240 |
# File 'lib/slack/web/api/endpoints/chat.rb', line 234 def chat_scheduleMessage( = {}) raise ArgumentError, 'Required arguments :channel missing' if [:channel].nil? raise ArgumentError, 'Required arguments :post_at missing' if [:post_at].nil? raise ArgumentError, 'At least one of :attachments, :blocks, :text is required' if [:attachments].nil? && [:blocks].nil? && [:text].nil? = (, %i[attachments blocks metadata]) post('chat.scheduleMessage', ) end |
#chat_startStream(options = {}) ⇒ Object
Starts a new streaming conversation.
257 258 259 260 261 262 |
# File 'lib/slack/web/api/endpoints/chat.rb', line 257 def chat_startStream( = {}) raise ArgumentError, 'Required arguments :channel missing' if [:channel].nil? raise ArgumentError, 'Required arguments :thread_ts missing' if [:thread_ts].nil? = .merge(channel: conversations_id()['channel']['id']) if [:channel] post('chat.startStream', ) end |
#chat_stopStream(options = {}) ⇒ Object
Stops a streaming conversation.
279 280 281 282 283 284 285 |
# File 'lib/slack/web/api/endpoints/chat.rb', line 279 def chat_stopStream( = {}) raise ArgumentError, 'Required arguments :channel missing' if [:channel].nil? raise ArgumentError, 'Required arguments :ts missing' if [:ts].nil? = .merge(channel: conversations_id()['channel']['id']) if [:channel] = (, %i[metadata]) post('chat.stopStream', ) end |
#chat_unfurl(options = {}) ⇒ Object
Provide custom unfurl behavior for user-posted URLs
312 313 314 315 316 |
# File 'lib/slack/web/api/endpoints/chat.rb', line 312 def chat_unfurl( = {}) = .merge(channel: conversations_id()['channel']['id']) if [:channel] = (, %i[unfurls user_auth_blocks metadata]) post('chat.unfurl', ) end |
#chat_update(options = {}) ⇒ Object
Updates a message.
347 348 349 350 351 352 353 354 |
# File 'lib/slack/web/api/endpoints/chat.rb', line 347 def chat_update( = {}) raise ArgumentError, 'Required arguments :channel missing' if [:channel].nil? raise ArgumentError, 'Required arguments :ts missing' if [:ts].nil? raise ArgumentError, 'At least one of :attachments, :blocks, :text is required' if [:attachments].nil? && [:blocks].nil? && [:text].nil? = .merge(channel: conversations_id()['channel']['id']) if [:channel] = (, %i[attachments blocks metadata]) post('chat.update', ) end |