mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 01:14:12 +08:00
FIX: Wrong discobot tutorial started for certain locales.
If a locale has triggers that start with the same word, our regexp will always end up matching the first trigger. For example, `start tutorial` and `start tutorial advanced` To support the change, we have to make the match on triggers more restrictive. `@discobot quote here` will no longer work like `@discobot quote`.
This commit is contained in:
@ -227,7 +227,7 @@ module DiscourseNarrativeBot
|
||||
|
||||
def match_trigger?(trigger)
|
||||
discobot_username = self.discobot_user.username
|
||||
regexp = Regexp.new("<a class=\"mention\".*>@#{discobot_username}</a> #{trigger}", 'i')
|
||||
regexp = Regexp.new("<a class=\"mention\".*>@#{discobot_username}</a> #{trigger}</p>", 'i')
|
||||
match = @post.cooked.match(regexp)
|
||||
|
||||
if @is_pm_to_bot
|
||||
|
Reference in New Issue
Block a user