📖 !quote help
"
""
"!quote – random popular quote from Goodreads "
"!quote <author> – random quote by that author "
"!quote help – this "
"
"
"Examples:
!quote
"
"!quote Terence McKenna
"
"!quote Oscar Wilde
"
"Scraped with Playwright (headless browser).
"
" "
)
await bot.api.send_markdown_message(room.room_id, help_html)
return
try:
if args:
author = " ".join(args).strip()
await bot.api.send_text_message(
room.room_id, f"🔍 Searching Goodreads for quotes by **{author}**…"
)
quotes = await get_author_quotes(author)
if not quotes:
await bot.api.send_text_message(
room.room_id,
f"❌ No quotes found for '**{author}**'. Try a different spelling."
)
return
chosen = random.choice(quotes)
else:
await bot.api.send_text_message(room.room_id, "✨ Fetching a random popular quote…")
quotes = await get_random_popular()
if not quotes:
await bot.api.send_text_message(room.room_id, "❌ Could not fetch any quotes.")
return
chosen = random.choice(quotes)
await bot.api.send_markdown_message(room.room_id, format_quote(chosen))
logger.info(f"Quote sent: {chosen['author']}")
except Exception as e:
logger.exception("Unexpected error in quote plugin")
await bot.api.send_text_message(
room.room_id, f"❌ Scraping error: {e}"
)
# ---------------------------------------------------------------------------
# Plugin metadata
# ---------------------------------------------------------------------------
__version__ = "1.0.1"
__author__ = "Funguy Bot"
__description__ = "Goodreads quotes via Playwright (headless browser)"
__help__ = """