diff --git a/bot.rb b/bot.rb index b70e3c9..4f76f14 100644 --- a/bot.rb +++ b/bot.rb @@ -60,11 +60,11 @@ bot.reaction_remove do |event| end bot.message(in: Integer(ENV['SENTENCE_CHANNEL'])) do |event| - if ['?', '!', '.', '...'].include? event.message.content + if ['?', '!', '.', '...', '?!'].include? event.message.content if $sentence.empty? next end - event << "Congratulations, your sentence is: #{$sentence.values.join(" ").gsub(/\s,/, ",")}#{event.message.content}" + event << "Congratulations, your sentence is: #{$sentence.values.join(" ").gsub(/\s([^\w\s])/, '\\\0')}#{event.message.content}" $sentence.clear next end