Add 'crypto' bot: streams CoinGecko prices to a channel

New crypto bot type: creates a broadcast channel and posts a price snapshot of the
selected coins/currencies (CoinGecko simple/price JSON) every interval — same
channel-streaming model as RSS. Create form has checkbox grids for popular coins
and currencies plus a poll interval. Generalize the channel helper and feed-poll
state (channel_gid/poll_next) shared by rss + crypto. Adds crypto_test.py (mock
CoinGecko) — passes; rss_test updated for the renamed field.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Jon
2026-06-05 22:31:44 +01:00
parent 7cda767408
commit 3456ed9411
4 changed files with 282 additions and 29 deletions

View File

@@ -96,7 +96,7 @@ async def main() -> int:
b = pm.get_running(BOT_PID)
# 1) channel created
gid = await wait_until(lambda: asyncio.sleep(0, b.rss_gid), timeout=90)
gid = await wait_until(lambda: asyncio.sleep(0, b.channel_gid), timeout=90)
print("channel created:", bool(gid), "gid", gid)
assert gid, "rss bot did not create a channel"