FIX: trigger commands are different for each locale, account for that.

This commit is contained in:
Arpit Jalan
2020-01-01 16:53:36 +05:30
parent ce512452b5
commit 57081acc08
7 changed files with 17 additions and 8 deletions

View File

@ -6,10 +6,14 @@ module Jobs
user = User.find_by(id: args[:user_id])
return if user.nil?
raw = I18n.t("discourse_narrative_bot.tl2_promotion_message.text_body_template",
discobot_username: ::DiscourseNarrativeBot::Base.new.discobot_user.username,
reset_trigger: "#{::DiscourseNarrativeBot::TrackSelector.reset_trigger} #{::DiscourseNarrativeBot::AdvancedUserNarrative.reset_trigger}")
PostCreator.create!(
Discourse.system_user,
title: I18n.t("discourse_narrative_bot.tl2_promotion_message.subject_template"),
raw: I18n.t("discourse_narrative_bot.tl2_promotion_message.text_body_template"),
raw: raw,
archetype: Archetype.private_message,
target_usernames: user.username,
skip_validations: true