<commit_before># reminder_handler.rb
#
# Author::  <NAME>

require 'chronic_duration'

class ReminderHandler < CommandHandler
  feature :reminders, default_enabled: true

  command :remindmein, :remind_me_in, feature: :reminders, min_args: 1,
      description: 'Reminds you of something in the given amount of time.'
  # TODO: command :remindmeat

  event :ready, :start_reminder_thread

  def config_name
    :reminders
  end

  def redis_name
    :reminders
  end

  def remind_me_in(event, *time_expr)
    time_str = time_expr.join(' ')
    time_secs = ChronicDuration.parse(time_str, keep_zero: true).truncate
    return "Invalid time: #{time_str}" if time_secs.zero?

    prompt_for_message(event, time_secs)

    nil
  end

  def start_reminder_thread(_event)<commit_msg>Added guard to prevent an error when time was larger than Redis's maximum allowable TTL<commit_after># reminder_handler.rb
#
# Author::  <NAME>

require 'chronic_duration'

class ReminderHandler < CommandHandler
  feature :reminders, default_enabled: true

  command :remindmein, :remind_me_in, feature: :reminders, min_args: 1,
      description: 'Reminds you of something in the given amount of time.'
  # TODO: command :remindmeat

  event :ready, :start_reminder_thread

  def config_name
    :reminders
  end

  def redis_name
    :reminders
  end

  def remind_me_in(event, *time_expr)
    time_str = time_expr.join(' ')
    time_secs = ChronicDuration.parse(time_str, keep_zero: true).truncate
    return "Invalid time: #{time_str}" if time_secs.zero?
    return "Time too large: #{time_str}" if time_secs >= 2_147_483_647

    prompt_for_message(event, time_secs)

    nil
  end

  def start_reminder_thread(_event)
{'fraction_non_alphanumeric': 0.08524397413286303, 'fraction_numerical': 0.007054673721340388, 'mean_word_length': 4.352201257861635, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '396033', 'n_tokens_mistral': 603, 'n_tokens_neox': 575, 'n_words': 153}