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 user’s currently scheduled 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

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 (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

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:



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

Provides information about the current Do Not Disturb settings for a list of users in 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:



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

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