by-monitor

Crates.ioby-monitor
lib.rsby-monitor
version1.2.0
created_at2025-11-04 00:34:57.660299+00
updated_at2025-11-04 12:21:10.97224+00
descriptionA command-line tool to monitor BringYour account statistics and send reports.
homepage
repository
max_upload_size
id1915504
size101,196
(An0nX)

documentation

README

BringYour Account Monitor (by-monitor)

by-monitor is a command-line utility for fetching account statistics from the BringYour API and sending formatted reports to Discord and/or Telegram.

Features

  • Fetches key statistics: provider status, average uptime, and traffic data.
  • Authenticates using either a JWT token or a login/password pair.
  • Sends clear, formatted reports to:
    • Discord (as rich "embed" messages with color and an icon).
    • Telegram (as messages with Markdown formatting).
  • Fully configurable via command-line arguments or environment variables.
  • Multi-language support for output (English, Russian).
  • Supports HTTP/HTTPS proxies.

Installation

Ensure you have Rust and Cargo installed. Then, run the command:

cargo install by-monitor

Usage

Examples

Send a report to Telegram using a login and password (output is in Russian by default):

by-monitor \
    --login <YOUR_LOGIN> \
    --password <YOUR_PASSWORD> \
    --telegram-bot-token <YOUR_BOT_TOKEN> \
    --telegram-chat-id <YOUR_CHAT_ID>

Send a report to Discord in English using a token:

by-monitor \
    --token <YOUR_TOKEN> \
    --language en \
    --discord-webhook-url <YOUR_WEBHOOK_URL>

Configuration

All parameters can be set via command-line arguments or environment variables.

Argument Environment Variable Description
--token BY_AUTH_TOKEN JWT token for authentication.
--login BY_LOGIN Login (email/phone) for authentication. Use with --password.
--password BY_PASSWORD Password for authentication.
--discord-webhook-url DISCORD_WEBHOOK_URL Discord webhook URL to send reports to.
--telegram-bot-token TELEGRAM_BOT_TOKEN Telegram Bot API token. Use with --telegram-chat-id.
--telegram-chat-id TELEGRAM_CHAT_ID Telegram Chat ID to send reports to. Can be negative.
--api-url BY_API_URL Base URL for the BringYour API. (Default: https://api.bringyour.com)
--proxy HTTPS_PROXY Proxy server URL (e.g., http://proxy.example.com:8080).
-l, --language BY_MONITOR_LANG Output language (ru, en). (Default: ru)

Report Examples

Discord

📊 Account Report

Network Stability (24h) 📡 Providers: 16/16 ⏱️ Average Uptime: 47.54%

Data & Traffic 📦 Traffic Quota: 120.00 GB ✅ Paid Traffic: 3.31 GB ⏳ Unpaid Traffic: 317.44 MB

Telegram

📊 Network Stability (24h) 📡 Providers: 16/16 ⏱️ Average Uptime: 47.54%

📈 Data & Traffic 📦 Traffic Quota: 120.00 GB ✅ Paid Traffic: 3.31 GB ⏳ Unpaid Traffic: 317.44 MB

Commit count: 0

cargo fmt