Telegram bot triggered by rust word.
-
Declare the env variables
$ export TELOXIDE_TOKEN=<Your token here>$ export DATABASE_URL=<Your postgress db url here>Optional — daily Hacker News digest (disabled unless
HN_DIGEST_CHAT_IDSis set):Variable Default Meaning HN_DIGEST_CHAT_IDS(unset = off) Comma-separated numeric chat ids, e.g. -1001234567890,-1009876543210. The bot must be able to post there (admin with "Post messages" in channels).HN_DIGEST_TIME_UTC17:00Daily post time, HH:MMin UTC.HN_DIGEST_TOP_N3Stories per digest, 1–10.HN_DIGEST_RUN_ON_STARTUPfalseAlso post once at startup. For local testing only — every restart/deploy posts again. On-demand digest: in any group the bot is in, send
/hn [1-10](default3). The bot replies with that many summarized top stories; an invalid count gets a usage hint. Each chat can run it once per 10 minutes (tracked in Redis). Works whether or not the daily digest is enabled. -
Create the database.
$ sqlx db create -
Run sql migrations
$ sqlx migrate run -
Build and run application
cargo run