mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
FIX: Capybara diet upgrade, can eat real 🌿 now (#11040)
More seriously: discobot wasn't reacting properly if users used their emoji keyboard to insert a real herb emoji, which works just as well in a real post. While we're here, use String#include? instead of constructing a new regexp. https://meta.discourse.org/t/capybaras-dont-eat-real-emojis/168361
This commit is contained in:
@ -141,6 +141,10 @@ module DiscourseNarrativeBot
|
||||
':herb:'
|
||||
end
|
||||
|
||||
def self.search_answer_emoji
|
||||
"\u{1F33F}"
|
||||
end
|
||||
|
||||
def self.reset_trigger
|
||||
I18n.t('discourse_narrative_bot.new_user_narrative.reset_trigger')
|
||||
end
|
||||
@ -567,7 +571,7 @@ module DiscourseNarrativeBot
|
||||
post_topic_id = @post.topic_id
|
||||
return unless valid_topic?(post_topic_id)
|
||||
|
||||
if @post.raw.match(/#{NewUserNarrative.search_answer}/)
|
||||
if @post.raw.include?(NewUserNarrative.search_answer) || @post.raw.include?(NewUserNarrative.search_answer_emoji)
|
||||
fake_delay
|
||||
reply_to(@post, I18n.t("#{I18N_KEY}.search.reply", i18n_post_args(search_url: url_helpers(:search_url))))
|
||||
else
|
||||
|
Reference in New Issue
Block a user