discourse/plugins/discourse-narrative-bot/lib/discourse_narrative_bot
Régis Hanol f00dfb922a
FIX: Use bundled quotes for discobot instead of dead external API (#40367)
The discobot `quote` and `help` commands fetched a random quote from the
external `api.forismatic.com` service for English locales. That host now
returns HTTP 521, so `QuoteGenerator.generate` (which calls Excon with
`expects: [200, 201]`) raised and crashed the `bot_input` job, leaving
users with no reply. `roll` and `fortune` kept working because they run
locally, and non-English locales were unaffected because they already
used bundled quotes.

This removes the external call entirely and samples from the locally
bundled quotes for the user's effective locale — the same data already
shipped for translations — so the commands work without any network
dependency and can no longer fail silently. Sampling over every
available quote also surfaces entries that the previous `rand(1..10)`
never reached.

Adds a `QuoteGenerator` unit spec and a `bot_input` job spec covering
the no-network reply path and error propagation.

Ref - t/184527
2026-05-28 17:37:29 +02:00
..
templates UX: improve discobot certificate font language support (#30722) 2025-01-10 17:13:24 -05:00
actions.rb DEV: Enable Style/RedundantSelf rubocop rule (#40098) 2026-05-19 19:27:45 +02:00
advanced_user_narrative.rb DEV: Enable Style/RedundantSelf rubocop rule (#40098) 2026-05-19 19:27:45 +02:00
base.rb DEV: Enable Style/RedundantSelf rubocop rule (#40098) 2026-05-19 19:27:45 +02:00
certificate_generator.rb DEV: Clean up scope resolution operators in plugins (#34979) 2025-09-30 14:36:34 +02:00
dice.rb
engine.rb
magic_8_ball.rb
new_user_narrative.rb DEV: Enable Style/RedundantSelf rubocop rule (#40098) 2026-05-19 19:27:45 +02:00
post_guardian_extension.rb DEV: Clean up scope resolution operators in plugins (#34979) 2025-09-30 14:36:34 +02:00
quote_generator.rb FIX: Use bundled quotes for discobot instead of dead external API (#40367) 2026-05-28 17:37:29 +02:00
store.rb
track_selector.rb DEV: Enable Style/RedundantSelf rubocop rule (#40098) 2026-05-19 19:27:45 +02:00
welcome_post_type_site_setting.rb