Module: Slack::Web::Api::Endpoints::Dnd

Included in:
Slack::Web::Api::Endpoints
Defined in:
lib/slack/web/api/endpoints/dnd.rb

Instance Method Summary collapse

Instance Method Details

#dnd_endDnd(options = {}) ⇒ Object

Ends the current user’s Do Not Disturb session immediately.



13
14
15
# File 'lib/slack/web/api/endpoints/dnd.rb', line 13

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/web/api/endpoints/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 (user)

    User to fetch status for (defaults to current user).

See Also:



33
34
35
36
# File 'lib/slack/web/api/endpoints/dnd.rb', line 33

def dnd_info(options = {})
  options = options.merge(user: users_id(options)['user']['id']) if options[:user]
  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:



45
46
47
48
# File 'lib/slack/web/api/endpoints/dnd.rb', line 45

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:



57
58
59
# File 'lib/slack/web/api/endpoints/dnd.rb', line 57

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