Module: Slack::Endpoint::Dnd

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

Instance Method Summary collapse

Instance Method Details

#dnd_endDnd(options = {}) ⇒ Object

Ends the user’s currently scheduled Do Not Disturb session immediately.



12
13
14
15
# File 'lib/slack/endpoint/dnd.rb', line 12

def dnd_endDnd(options={})
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("dnd.endDnd", options)
end

#dnd_endSnooze(options = {}) ⇒ Object

Ends the current user’s snooze mode immediately.



23
24
25
26
# File 'lib/slack/endpoint/dnd.rb', line 23

def dnd_endSnooze(options={})
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("dnd.endSnooze", options)
end

#dnd_info(options = {}) ⇒ Object

Provides information about a user’s current Do Not Disturb settings.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :user (Object)

    User to fetch status for (defaults to current user)

See Also:



36
37
38
39
# File 'lib/slack/endpoint/dnd.rb', line 36

def dnd_info(options={})
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("dnd.info", options)
end

#dnd_setSnooze(options = {}) ⇒ Object

Adjusts the snooze duration for a user’s Do Not Disturb settings. If a snooze session is not already active for the user, invoking this method will begin one for the specified duration.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :num_minutes (Object)

    Number of minutes, from now, to snooze until.

See Also:



49
50
51
52
53
# File 'lib/slack/endpoint/dnd.rb', line 49

def dnd_setSnooze(options={})
  throw ArgumentError.new("Required arguments :num_minutes missing") if options[:num_minutes].nil?
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("dnd.setSnooze", options)
end

#dnd_teamInfo(options = {}) ⇒ Object

Provides information about the current Do Not Disturb settings for users of a Slack team.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :users (Object)

    Comma-separated list of users to fetch Do Not Disturb status for

See Also:



63
64
65
66
# File 'lib/slack/endpoint/dnd.rb', line 63

def dnd_teamInfo(options={})
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("dnd.teamInfo", options)
end