module Slack::Web::Api::Endpoints::Dnd

Public Instance Methods

dnd_endDnd(options = {}) click to toggle source

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

@see api.slack.com/methods/dnd.endDnd @see github.com/dblock/slack-api-ref/blob/master/methods/dnd.endDnd.json

# File lib/slack/web/api/endpoints/dnd.rb, line 13
def dnd_endDnd(options = {})
  post('dnd.endDnd', options)
end
dnd_endSnooze(options = {}) click to toggle source

Ends the current user's snooze mode immediately.

@see api.slack.com/methods/dnd.endSnooze @see github.com/dblock/slack-api-ref/blob/master/methods/dnd.endSnooze.json

# File lib/slack/web/api/endpoints/dnd.rb, line 22
def dnd_endSnooze(options = {})
  post('dnd.endSnooze', options)
end
dnd_info(options = {}) click to toggle source

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

@option options [user] :user

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

@see api.slack.com/methods/dnd.info @see github.com/dblock/slack-api-ref/blob/master/methods/dnd.info.json

# 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 = {}) click to toggle source

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.

@option options [Object] :num_minutes

Number of minutes, from now, to snooze until.

@see api.slack.com/methods/dnd.setSnooze @see github.com/dblock/slack-api-ref/blob/master/methods/dnd.setSnooze.json

# 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 = {}) click to toggle source

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

@option options [Object] :users

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

@see api.slack.com/methods/dnd.teamInfo @see github.com/dblock/slack-api-ref/blob/master/methods/dnd.teamInfo.json

# File lib/slack/web/api/endpoints/dnd.rb, line 57
def dnd_teamInfo(options = {})
  post('dnd.teamInfo', options)
end