FIX: Skip trigger match should be case insensitive.

https://meta.discourse.org/t/discobot-not-skipping-tutorial/68498
This commit is contained in:
Guo Xiang Tan
2017-08-22 07:44:20 +09:00
parent 8bd7cfedfd
commit 950fa9e3a8
3 changed files with 5 additions and 7 deletions

View File

@ -217,9 +217,7 @@ module DiscourseNarrativeBot
def skip_track?
if @is_pm_to_bot
post_raw = @post.raw
post_raw.match(/^@#{self.discobot_user.username} #{self.class.skip_trigger}/i) ||
post_raw.strip == self.class.skip_trigger
post_raw.match(/((^@#{self.discobot_user.username} #{self.class.skip_trigger})|(^#{self.class.skip_trigger}$))/i)
else
false
end