Created
August 26, 2014 15:04
-
-
Save Thanatermesis/4ca4c4558e0bab38a30f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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