Module: Slack::Web::Api::Endpoints::Reminders

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

Instance Method Summary collapse

Instance Method Details

#reminders_add(options = {}) ⇒ Object

Creates a reminder.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :text (Object)

    The content of the reminder.

  • :time (Object)

    When this reminder should happen: the Unix timestamp (up to five years from now), the number of seconds until the reminder (if within 24 hours), or a natural language description (Ex. “in 15 minutes,” or “every Thursday”).

  • :user (user)

    The user who will receive the reminder. If no user is specified, the reminder will go to user who created it.

See Also:



20
21
22
23
24
25
# File 'lib/slack/web/api/endpoints/reminders.rb', line 20

def reminders_add(options = {})
  throw ArgumentError.new('Required arguments :text missing') if options[:text].nil?
  throw ArgumentError.new('Required arguments :time missing') if options[:time].nil?
  options = options.merge(user: users_id(options)['user']['id']) if options[:user]
  post('reminders.add', options)
end

#reminders_complete(options = {}) ⇒ Object

Marks a reminder as complete.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :reminder (Object)

    The ID of the reminder to be marked as complete.

See Also:



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

def reminders_complete(options = {})
  throw ArgumentError.new('Required arguments :reminder missing') if options[:reminder].nil?
  post('reminders.complete', options)
end

#reminders_delete(options = {}) ⇒ Object

Deletes a reminder.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :reminder (Object)

    The ID of the reminder.

See Also:



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

def reminders_delete(options = {})
  throw ArgumentError.new('Required arguments :reminder missing') if options[:reminder].nil?
  post('reminders.delete', options)
end

#reminders_info(options = {}) ⇒ Object

Gets information about a reminder.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :reminder (Object)

    The ID of the reminder.

See Also:



58
59
60
61
# File 'lib/slack/web/api/endpoints/reminders.rb', line 58

def reminders_info(options = {})
  throw ArgumentError.new('Required arguments :reminder missing') if options[:reminder].nil?
  post('reminders.info', options)
end

#reminders_list(options = {}) ⇒ Object

Lists all reminders created by or for a given user.



68
69
70
# File 'lib/slack/web/api/endpoints/reminders.rb', line 68

def reminders_list(options = {})
  post('reminders.list', options)
end