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_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_unfurl(options = {}) ⇒ Object
Provide custom unfurl behavior for user-posted URLs.
-
#chat_update(options = {}) ⇒ Object
Updates a message.
Instance Method Details
#chat_command(options = {}) ⇒ Object
Execute a slash command in a public channel (undocumented)
19 20 21 22 23 24 25 |
# File 'lib/slack/web/api/endpoints/chat.rb', line 19 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.
38 39 40 41 42 43 |
# File 'lib/slack/web/api/endpoints/chat.rb', line 38 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.
56 57 58 59 60 61 |
# File 'lib/slack/web/api/endpoints/chat.rb', line 56 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
72 73 74 75 76 77 |
# File 'lib/slack/web/api/endpoints/chat.rb', line 72 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.
88 89 90 91 92 |
# File 'lib/slack/web/api/endpoints/chat.rb', line 88 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.
123 124 125 126 127 128 129 130 |
# File 'lib/slack/web/api/endpoints/chat.rb', line 123 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.
169 170 171 172 173 174 |
# File 'lib/slack/web/api/endpoints/chat.rb', line 169 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.
207 208 209 210 211 212 213 |
# File 'lib/slack/web/api/endpoints/chat.rb', line 207 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_unfurl(options = {}) ⇒ Object
Provide custom unfurl behavior for user-posted URLs
238 239 240 241 242 243 244 245 |
# File 'lib/slack/web/api/endpoints/chat.rb', line 238 def chat_unfurl( = {}) raise ArgumentError, 'Required arguments :channel missing' if [:channel].nil? raise ArgumentError, 'Required arguments :ts missing' if [:ts].nil? raise ArgumentError, 'Required arguments :unfurls missing' if [:unfurls].nil? = .merge(channel: conversations_id()['channel']['id']) if [:channel] = (, %i[unfurls user_auth_blocks]) post('chat.unfurl', ) end |
#chat_update(options = {}) ⇒ Object
Updates a message.
274 275 276 277 278 279 280 281 |
# File 'lib/slack/web/api/endpoints/chat.rb', line 274 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 |