mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 05:01:14 +08:00
FEATURE: Send a message to new TL2 users and point them to the advanced tutorial (#8335)
* FEATURE: Send a message to new TL2 users and point them to the advanced tutorial * DEV: Use a method to find the discobot user
This commit is contained in:
@ -33,6 +33,7 @@ after_initialize do
|
||||
'../autoload/jobs/narrative_timeout.rb',
|
||||
'../autoload/jobs/narrative_init.rb',
|
||||
'../autoload/jobs/send_default_welcome_message.rb',
|
||||
'../autoload/jobs/send_advanced_tutorial_message.rb',
|
||||
'../autoload/jobs/onceoff/grant_badges.rb',
|
||||
'../autoload/jobs/onceoff/remap_old_bot_images.rb',
|
||||
'../lib/discourse_narrative_bot/actions.rb',
|
||||
@ -245,4 +246,13 @@ after_initialize do
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
self.on(:user_promoted) do |args|
|
||||
promoted_from_tl1 = args[:new_trust_level] == TrustLevel[2] &&
|
||||
args[:old_trust_level] == TrustLevel[1]
|
||||
|
||||
if SiteSetting.discourse_narrative_bot_enabled && promoted_from_tl1
|
||||
Jobs.enqueue(:send_advanced_tutorial_message, user_id: args[:user_id])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user