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:



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

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:



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

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:



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

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:



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

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.



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

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