Add IsThereAnyDeal as a deal source alongside CheapShark
Users can now choose between CheapShark, ITAD, or both via the DEAL_SOURCES env var (comma-separated, default: "cheapshark"). When "itad" is included, the bot polls GET /deals/v2 for current deals with discount/price filtering and posts them with the same formatting style. ITAD deals include built-in historical low detection via the API's deal flags. Preflight checks enforce ITAD_API_KEY when ITAD is a configured deal source. https://claude.ai/code/session_01B7YPGrE3NatkwadCXVjv2j
This commit is contained in:
@@ -48,14 +48,25 @@ async def main():
|
||||
|
||||
scheduler = AsyncIOScheduler()
|
||||
|
||||
# CheapShark: every 2 hours
|
||||
scheduler.add_job(
|
||||
bot.check_cheapshark,
|
||||
"interval",
|
||||
hours=2,
|
||||
id="cheapshark",
|
||||
name="CheapShark deals check",
|
||||
)
|
||||
# CheapShark: every 2 hours (if enabled)
|
||||
if "cheapshark" in config.deal_sources:
|
||||
scheduler.add_job(
|
||||
bot.check_cheapshark,
|
||||
"interval",
|
||||
hours=2,
|
||||
id="cheapshark",
|
||||
name="CheapShark deals check",
|
||||
)
|
||||
|
||||
# ITAD deals: every 2 hours (if enabled)
|
||||
if "itad" in config.deal_sources:
|
||||
scheduler.add_job(
|
||||
bot.check_itad_deals,
|
||||
"interval",
|
||||
hours=2,
|
||||
id="itad_deals",
|
||||
name="ITAD deals check",
|
||||
)
|
||||
|
||||
# Epic free games: once daily
|
||||
scheduler.add_job(
|
||||
@@ -67,12 +78,16 @@ async def main():
|
||||
)
|
||||
|
||||
scheduler.start()
|
||||
logger.info("Bot started — scheduler running")
|
||||
logger.info(
|
||||
"Bot started — scheduler running (deal sources: %s)",
|
||||
", ".join(config.deal_sources),
|
||||
)
|
||||
|
||||
await bot.send_intro()
|
||||
|
||||
# Run initial checks immediately (after first-run population is done)
|
||||
await bot.check_cheapshark()
|
||||
await bot.check_itad_deals()
|
||||
await bot.check_epic_free_games()
|
||||
|
||||
# Keep running until signaled to stop
|
||||
|
||||
Reference in New Issue
Block a user