npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

telegram_alerts

v1.1.0

Published

The telegram_alerts is a comprehensive alerting module designed for a Telegram bot application. It not only facilitates sending formatted alerts about cryptocurrency volume changes on exchanges like Binance and Kucoin but also integrates listeners for Dex

Downloads

16

Readme

Telegram Alerts Module

The telegram_alerts is a comprehensive alerting module designed for a Telegram bot application. It not only facilitates sending formatted alerts about cryptocurrency volume changes on exchanges like Binance and Kucoin but also integrates listeners for Dextools URLs, Dexscreener URLs and also direct addresses for broader monitoring capabilities. Utilizing additional modules for formatting and determining alert levels, this script stands as a central hub for notification dispatch within the bot ecosystem.

Features

- Versatile Alerting: Supports a wide range of alerts including exchange volume changes, Dextools and Dexscreener link detections, and direct address alerts.

- Dynamic Message Formatting: Leverages the formatting_btk module to format numerical values for easier readability.

- Alert Level Analysis: Integrates with alert_levels_tg to assess and communicate the significance of volume changes.

- Secure Configuration: Manages sensitive information such as API keys and bot tokens through a dedicated credentials_telegram.json file.

Dependencies

- Python 3.6+: Required for running the script.

- Requests: For making HTTP requests to the Telegram API.

- formatting_btk: A custom module for formatting numbers.

- alert_levels_tg: A custom module for determining and describing alert levels based on predefined criteria.

Installation

1. Ensure Python and Pip are installed:

Verify Python 3.6+ and pip are installed on your system by running python --version and pip --version.

2. Install Dependencies:

Install the Requests library and ensure formatting_btk and alert_levels_tg modules are accessible within your project environment:

pip install requests

3. Configure Credentials:

Edit credentials_telegram.json to include your Telegram bot's credentials. This file should be securely stored and properly referenced by the script.

{
  "Telegram_bot_token": "INSERT YOUR TELEGRAM BOT TOKEN HERE (operational bot-1)",
  "Telegram_chat_id": "INSERT THE TELEGRAM CHAT ID HERE WHERE YOU WANT TO RECEIVE TELEGRAM BOT NOTIFICATIONS (operational chat_id-1)"
  "bot_token_1": "insert your_bot_token_here (operational bot-2)",
  "chat_id_1": "insert your_listener_chat_id_here (operational chat_id-2)",
  "response_chat_id": "insert your_response_chat_id_here",
  "api_id": "insert_your_api_id_here",
  "api_hash": "insert_your_api_hash_here",
  "dextools_api_key": "insert_your_dextools_api_key_here"
}

Usage

The script is designed to be imported and utilized by other components within the bot application:

from telegram_alerts import handle_and_send_message

# Example alert details
alert_details = {
    'exchange': 'Binance',
    'symbol': 'BTC/USDT',
    'curr_volume': 10234.56,
    'prev_volume_mean': 9786.43,
    'level': 'High',
    'chart_url': 'https://example.com/chart'
}

credentials = load_telegram_credentials()
send_telegram_message(alert_details)

This will format and send an alert message to the specified Telegram chat or channel based on the provided details.

Contributing

Contributions are welcome! If you have ideas for new features, improvements, or bug fixes, feel free to fork the repository, make your changes, and submit a pull request.

Support

For issues, questions, or contributions, please open an issue in the GitHub repository.

Feedback and contributions are welcome!

License

This project is licensed under the MIT License - see the LICENSE file for details.