Module: Slack::Endpoint::Conversations

Included in:
Slack::Endpoint
Defined in:
lib/slack/endpoint/conversations.rb

Instance Method Summary collapse

Instance Method Details

#conversations_archive(options = {}) ⇒ Object

Archives a conversation.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    ID of conversation to archive

See Also:



14
15
16
17
# File 'lib/slack/endpoint/conversations.rb', line 14

def conversations_archive(options={})
  throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
  post("conversations.archive", options)
end

#conversations_close(options = {}) ⇒ Object

Closes a direct message or multi-person direct message.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    Conversation to close.

See Also:



27
28
29
30
# File 'lib/slack/endpoint/conversations.rb', line 27

def conversations_close(options={})
  throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
  post("conversations.close", options)
end

#conversations_create(options = {}) ⇒ Object

Initiates a public or private channel-based conversation

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :name (Object)

    Name of the public or private channel to create

  • :is_private (Object)

    Create a private channel instead of a public one

See Also:



42
43
44
45
# File 'lib/slack/endpoint/conversations.rb', line 42

def conversations_create(options={})
  throw ArgumentError.new("Required arguments :name missing") if options[:name].nil?
  post("conversations.create", options)
end

#conversations_history(options = {}) ⇒ Object

Fetches a conversation’s history of messages and events.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    Conversation ID to fetch history for.

  • :cursor (Object)

    Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request’s response_metadata. Default value fetches the first “page” of the collection. See pagination for more detail.

  • :inclusive (Object)

    Include messages with latest or oldest timestamp in results only when either timestamp is specified.

  • :latest (Object)

    End of time range of messages to include in results.

  • :limit (Object)

    The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn’t been reached.

  • :oldest (Object)

    Start of time range of messages to include in results.

See Also:



65
66
67
68
# File 'lib/slack/endpoint/conversations.rb', line 65

def conversations_history(options={})
  throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
  post("conversations.history", options)
end

#conversations_info(options = {}) ⇒ Object

Retrieve information about a conversation.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    Conversation ID to learn more about

  • :include_locale (Object)

    Set this to true to receive the locale for this conversation. Defaults to false

See Also:



80
81
82
83
# File 'lib/slack/endpoint/conversations.rb', line 80

def conversations_info(options={})
  throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
  post("conversations.info", options)
end

#conversations_invite(options = {}) ⇒ Object

Invites users to a channel.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    The ID of the public or private channel to invite user(s) to.

  • :users (Object)

    A comma separated list of user IDs. Up to 30 users may be listed.

See Also:



95
96
97
98
99
# File 'lib/slack/endpoint/conversations.rb', line 95

def conversations_invite(options={})
  throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
  throw ArgumentError.new("Required arguments :users missing") if options[:users].nil?
  post("conversations.invite", options)
end

#conversations_join(options = {}) ⇒ Object

Joins an existing conversation.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    ID of conversation to join

See Also:



109
110
111
112
# File 'lib/slack/endpoint/conversations.rb', line 109

def conversations_join(options={})
  throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
  post("conversations.join", options)
end

#conversations_kick(options = {}) ⇒ Object

Removes a user from a conversation.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    ID of conversation to remove user from.

  • :user (Object)

    User ID to be removed.

See Also:



124
125
126
127
128
# File 'lib/slack/endpoint/conversations.rb', line 124

def conversations_kick(options={})
  throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
  throw ArgumentError.new("Required arguments :user missing") if options[:user].nil?
  post("conversations.kick", options)
end

#conversations_leave(options = {}) ⇒ Object

Leaves a conversation.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    Conversation to leave

See Also:



138
139
140
141
# File 'lib/slack/endpoint/conversations.rb', line 138

def conversations_leave(options={})
  throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
  post("conversations.leave", options)
end

#conversations_list(options = {}) ⇒ Object

Lists all channels in a Slack team.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :cursor (Object)

    Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request’s response_metadata. Default value fetches the first “page” of the collection. See pagination for more detail.

  • :exclude_archived (Object)

    Set to true to exclude archived channels from the list

  • :limit (Object)

    The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn’t been reached. Must be an integer no larger than 1000.

  • :types (Object)

    Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im

See Also:



157
158
159
# File 'lib/slack/endpoint/conversations.rb', line 157

def conversations_list(options={})
  post("conversations.list", options)
end

#conversations_members(options = {}) ⇒ Object

Retrieve members of a conversation.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    ID of the conversation to retrieve members for

  • :cursor (Object)

    Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request’s response_metadata. Default value fetches the first “page” of the collection. See pagination for more detail.

  • :limit (Object)

    The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn’t been reached.

See Also:



173
174
175
176
# File 'lib/slack/endpoint/conversations.rb', line 173

def conversations_members(options={})
  throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
  post("conversations.members", options)
end

#conversations_open(options = {}) ⇒ Object

Opens or resumes a direct message or multi-person direct message.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    Resume a conversation by supplying an im or mpim’s ID. Or provide the users field instead.

  • :return_im (Object)

    Boolean, indicates you want the full IM channel definition in the response.

  • :users (Object)

    Comma separated lists of users. If only one user is included, this creates a 1:1 DM. The ordering of the users is preserved whenever a multi-person direct message is returned. Supply a channel when not supplying users.

See Also:



190
191
192
# File 'lib/slack/endpoint/conversations.rb', line 190

def conversations_open(options={})
  post("conversations.open", options)
end

#conversations_rename(options = {}) ⇒ Object

Renames a conversation.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    ID of conversation to rename

  • :name (Object)

    New name for conversation.

See Also:



204
205
206
207
208
# File 'lib/slack/endpoint/conversations.rb', line 204

def conversations_rename(options={})
  throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
  throw ArgumentError.new("Required arguments :name missing") if options[:name].nil?
  post("conversations.rename", options)
end

#conversations_replies(options = {}) ⇒ Object

Retrieve a thread of messages posted to a conversation

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    Conversation ID to fetch thread from.

  • :ts (Object)

    Unique identifier of a thread’s parent message.

  • :cursor (Object)

    Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request’s response_metadata. Default value fetches the first “page” of the collection. See pagination for more detail.

  • :inclusive (Object)

    Include messages with latest or oldest timestamp in results only when either timestamp is specified.

  • :latest (Object)

    End of time range of messages to include in results.

  • :limit (Object)

    The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn’t been reached.

  • :oldest (Object)

    Start of time range of messages to include in results.

See Also:



230
231
232
233
234
# File 'lib/slack/endpoint/conversations.rb', line 230

def conversations_replies(options={})
  throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
  throw ArgumentError.new("Required arguments :ts missing") if options[:ts].nil?
  post("conversations.replies", options)
end

#conversations_setPurpose(options = {}) ⇒ Object

Sets the purpose for a conversation.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    Conversation to set the purpose of

  • :purpose (Object)

    A new, specialer purpose

See Also:



246
247
248
249
250
# File 'lib/slack/endpoint/conversations.rb', line 246

def conversations_setPurpose(options={})
  throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
  throw ArgumentError.new("Required arguments :purpose missing") if options[:purpose].nil?
  post("conversations.setPurpose", options)
end

#conversations_setTopic(options = {}) ⇒ Object

Sets the topic for a conversation.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    Conversation to set the topic of

  • :topic (Object)

    The new topic string. Does not support formatting or linkification.

See Also:



262
263
264
265
266
# File 'lib/slack/endpoint/conversations.rb', line 262

def conversations_setTopic(options={})
  throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
  throw ArgumentError.new("Required arguments :topic missing") if options[:topic].nil?
  post("conversations.setTopic", options)
end

#conversations_unarchive(options = {}) ⇒ Object

Reverses conversation archival.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :channel (Object)

    ID of conversation to unarchive

See Also:



276
277
278
279
# File 'lib/slack/endpoint/conversations.rb', line 276

def conversations_unarchive(options={})
  throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
  post("conversations.unarchive", options)
end