From e56aac740b36e3fb24675ce61e0bf17522d1dd8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lera=20Elvo=C3=A9?= Date: Mon, 13 Feb 2023 14:59:41 +0300 Subject: [PATCH] remove space before all punctuation and add interrobang --- bot.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot.rb b/bot.rb index b70e3c9..74711ec 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])/, '\1')}#{event.message.content}" $sentence.clear next end