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

    The content of the reminder.

  • :time (string)

    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”).

  • :recurrence (object)

    Specify the repeating behavior of a reminder. Available options: daily, weekly, monthly, or yearly. If weekly, may further specify the days of the week.

  • :team_id (string)

    Encoded team id, required if org token is used.

  • :user (user)

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

Raises:

  • (ArgumentError)

See Also:



24
25
26
27
28
29
# File 'lib/slack/web/api/endpoints/reminders.rb', line 24

def reminders_add(options = {})
  raise ArgumentError, 'Required arguments :text missing' if options[:text].nil?
  raise ArgumentError, '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 (string)

    The ID of the reminder to be marked as complete.

  • :team_id (string)

    Encoded team id, required if org token is used.

Raises:

  • (ArgumentError)

See Also:



40
41
42
43
# File 'lib/slack/web/api/endpoints/reminders.rb', line 40

def reminders_complete(options = {})
  raise ArgumentError, '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 (string)

    The ID of the reminder.

  • :team_id (string)

    Encoded team id, required if org token is used.

Raises:

  • (ArgumentError)

See Also:



54
55
56
57
# File 'lib/slack/web/api/endpoints/reminders.rb', line 54

def reminders_delete(options = {})
  raise ArgumentError, '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 (string)

    The ID of the reminder.

  • :team_id (string)

    Encoded team id, required if org token is passed.

Raises:

  • (ArgumentError)

See Also:



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

def reminders_info(options = {})
  raise ArgumentError, '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.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :team_id (string)

    Encoded team id, required if org token is passed.

See Also:



80
81
82
# File 'lib/slack/web/api/endpoints/reminders.rb', line 80

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