Skip to content

Instantly share code, notes, and snippets.

@Thanatermesis
Created August 26, 2014 15:04
Show Gist options
  • Save Thanatermesis/4ca4c4558e0bab38a30f to your computer and use it in GitHub Desktop.
Save Thanatermesis/4ca4c4558e0bab38a30f to your computer and use it in GitHub Desktop.
@keywords.each do |k,v|
Regexp.new(k, Regexp::IGNORECASE).match(m.message) do |r|
# give her some humanity
# this is supposed to say: ( words * 60 ) / words-per-minute
delayed_answer = ( ( v.split.size * 60 ) / 120 ).to_f
# add 3 more seconds of humanity
delayed_answer = delayed_answer + 3
#m.reply delayed_answer
# wait and...
sleep delayed_answer
# answer !
m.reply v
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment