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:
Roman Rizzi
2021-03-29 14:21:30 -03:00
committed by GitHub
parent f0b2e77abb
commit 87b5d16c10
5 changed files with 29 additions and 3 deletions

View File

@ -126,7 +126,9 @@ module DiscourseNarrativeBot
def bot_commands(hint = true)
raw =
if match_data = match_trigger?("#{self.class.dice_trigger} (\\d+)d(\\d+)")
if @user.manually_disabled_discobot?
I18n.t(self.class.i18n_key('random_mention.discobot_disabled'))
elsif match_data = match_trigger?("#{self.class.dice_trigger} (\\d+)d(\\d+)")
DiscourseNarrativeBot::Dice.roll(match_data[1].to_i, match_data[2].to_i)
elsif match_trigger?(self.class.quote_trigger)
DiscourseNarrativeBot::QuoteGenerator.generate(@user)