WaffleLapkin / crate_upd_bot

Telegram bot that notifies about crate updates

Home Page:https://t.me/crates_upd_bot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Warning

(2024-02-13) This project is archived & the bot is no longer running. I have not been able to make the git pulling mechanism work reliably, across the index squashes and the bot was generally very junky. Sorry to anyone who used the bot, but I'm not interested anymore in maintaining this.

crate_upd_bot

CI status Telegram (bot) LICENSE

Telegram bot that notifies about crate updates (new versions, yanked versions and unyanked versions).

The bot is hosted by me under @crates_upd_bot nickname in telegram. Feel free to use it ;)

If you want to see all updates, subscribe to @crates_updates (warning: there are a lot of updates every day)

Bot interface

The bot supports 3 straightforward commands:

  • /subscribe <crate> — subscribe for <crate> updates (bot will notify you in PM)
  • /unsubscribe <crate> — unsubscribe for <crate> updates
  • /list — list your current subscriptions

How it works

Every pull_delay (default to 5 min) the bot fetches changes from crates.io-index repo, walks through all commits, parses diffs & notifies users.

State of the project

It's not my main project, so I don't spend much time on it. The code is pretty weird & needs a lot of improvements, though it seems to work.

All contributions are appreciated.

Deployment

  1. Create a postgresql database. It will store user subscriptions.
  2. Execute db.sql in the database.
  3. build the bot
    cargo build --release
  4. Edit config.toml. You must set bot_token and db.{host,user,dbname} though you may set other settings too.
  5. Run the binary created in (3). (target/release/crate_upd_bot)

(probably it would be better to create a docker image & setup auto deploy, maybe some day....)

About

Telegram bot that notifies about crate updates

https://t.me/crates_upd_bot

License:MIT License


Languages

Language:Rust 93.7%Language:PLpgSQL 6.3%