mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 06:14:12 +08:00
UX: Let users know they disabled discobot and they can't interact with it. (#12534)
Discobot will reply to users they need to enable onboarding tips to interact with them when issued a command.
This commit is contained in:
@ -163,7 +163,7 @@ after_initialize do
|
||||
|
||||
case SiteSetting.discourse_narrative_bot_welcome_post_type
|
||||
when 'new_user_track'
|
||||
if enqueue_narrative_bot_job?
|
||||
if enqueue_narrative_bot_job? && !manually_disabled_discobot?
|
||||
Jobs.enqueue_in(delay, :narrative_init,
|
||||
user_id: self.id,
|
||||
klass: DiscourseNarrativeBot::NewUserNarrative.to_s
|
||||
@ -174,12 +174,15 @@ after_initialize do
|
||||
end
|
||||
end
|
||||
|
||||
self.add_to_class(:user, :manually_disabled_discobot?) do
|
||||
user_option&.skip_new_user_tips
|
||||
end
|
||||
|
||||
self.add_to_class(:user, :enqueue_narrative_bot_job?) do
|
||||
SiteSetting.discourse_narrative_bot_enabled &&
|
||||
self.human? &&
|
||||
!self.anonymous? &&
|
||||
!self.staged &&
|
||||
!user_option&.skip_new_user_tips &&
|
||||
!SiteSetting.discourse_narrative_bot_ignored_usernames.split('|'.freeze).include?(self.username)
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user