mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: discobot fails when max_emojis_in_title=0 (#5710)
* If discobot is enabled but max_emojis_in_title==0, try to strip emoji from the title when creating a new post
This commit is contained in:

committed by
Régis Hanol

parent
0187423c68
commit
ed4d7ae1b9
@ -182,8 +182,13 @@ module DiscourseNarrativeBot
|
||||
#{instance_eval(&@next_instructions)}
|
||||
RAW
|
||||
|
||||
title = I18n.t("#{I18N_KEY}.hello.title", title: SiteSetting.title)
|
||||
if SiteSetting.max_emojis_in_title == 0
|
||||
title = title.gsub(/:([\w\-+]+(?::t\d)?):/, '').strip
|
||||
end
|
||||
|
||||
opts = {
|
||||
title: I18n.t("#{I18N_KEY}.hello.title", title: SiteSetting.title),
|
||||
title: title,
|
||||
target_usernames: @user.username,
|
||||
archetype: Archetype.private_message,
|
||||
subtype: TopicSubtype.system_message,
|
||||
|
Reference in New Issue
Block a user