From 153b1150a6ff625aebee42edb8a140c8fcf74647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lera=20Elvo=C3=A9?= Date: Mon, 13 Feb 2023 14:54:15 +0300 Subject: [PATCH] remove space before comma --- bot.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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