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 current user’s Do Not Disturb session immediately.



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

def dnd_endDnd(options={})
  post("dnd.endDnd", options)
end

#dnd_endSnooze(options = {}) ⇒ Object

Ends the current user’s snooze mode immediately.



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

def dnd_endSnooze(options={})
  post("dnd.endSnooze", options)
end

#dnd_info(options = {}) ⇒ Object

Retrieves a user’s current Do Not Disturb status.

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:



34
35
36
# File 'lib/slack/endpoint/dnd.rb', line 34

def dnd_info(options={})
  post("dnd.info", options)
end

#dnd_setSnooze(options = {}) ⇒ Object

Turns on Do Not Disturb mode for the current user, or changes its 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:



46
47
48
49
# File 'lib/slack/endpoint/dnd.rb', line 46

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

#dnd_teamInfo(options = {}) ⇒ Object

Retrieves the Do Not Disturb status for users on a 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:



59
60
61
# File 'lib/slack/endpoint/dnd.rb', line 59

def dnd_teamInfo(options={})
  post("dnd.teamInfo", options)
end