Skip to content

Conversation

leejw51crypto
Copy link
Collaborator

Enhance Telegram bot functionality and add transaction analysis feature

  • Updated bot.py to improve the Telegram bot's initialization and message handling.
  • Introduced a new CronosTransactionAnalyzer class for analyzing and describing transactions on the Cronos EVM.
  • Added transaction analysis capabilities, including detailed descriptions and technical breakdowns for user queries.
  • Updated requirements.txt to reflect the latest version of cryptocom-agent-client and python-telegram-bot for compatibility.
  • Improved logging setup for better debugging and user experience.

Pull Request Template

Description

Please include a summary of the change and which issue is fixed. Include the context and motivations behind your changes.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

Before you submit the pull request, please review the following checklist:

  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • Any dependent changes have been merged and published in downstream modules.

Linked Issues

Mention the issues that are addressed by this PR. You can use the # symbol to link an issue.


import pytz
from crypto_com_agent_client import Agent, tool, SQLitePlugin
from crypto_com_agent_client import Agent, SQLitePlugin, tool
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@leejw51crypto
Copy link
Collaborator Author

refactor to use rpc endpoint from the franework

modifying to use tg plugin

@leejw51crypto leejw51crypto force-pushed the feature/439 branch 2 times, most recently from 626e608 to 5b6fd49 Compare September 4, 2025 07:09
@leejw51crypto
Copy link
Collaborator Author

leejw51crypto commented Sep 4, 2025

found some issue for tg plugin, after first message, second message not arrives, checking now

it's by sqlite , turn off sqlite-plugin, using tg-plugin instead of directly using telegram pypi

Enhance Telegram bot functionality and add transaction analysis feature

- Updated bot.py to improve the Telegram bot's initialization and message handling.
- Introduced a new CronosTransactionAnalyzer class for analyzing and describing transactions on the Cronos EVM.
- Added transaction analysis capabilities, including detailed descriptions and technical breakdowns for user queries.
- Updated requirements.txt to reflect the latest version of cryptocom-agent-client and python-telegram-bot for compatibility.
- Improved logging setup for better debugging and user experience.

Refactor transaction analysis output in bot.py and cronos_tx_analyzer.py

- Enhanced the transaction information display in the Telegram bot by restructuring the output format for better readability.
- Updated the interaction prompts in the interactive mode to remove emojis and improve clarity.
- Added detailed sections for transaction descriptions and technical details, ensuring consistent formatting across responses.
- Improved error handling messages for a cleaner user experience.

Enhance CronosTransactionAnalyzer initialization and chain ID retrieval

- Updated the CronosTransactionAnalyzer class to accept a dashboard API key for improved chain identification.
- Implemented logic to dynamically determine the RPC URL and chain ID based on the provided API key or fallback to defaults.
- Added a method to fetch the chain ID from the dashboard API, enhancing flexibility and usability in transaction analysis.
- Modified bot.py to initialize the analyzer with the dashboard API key for better integration.
…pabilities

- Updated bot.py to utilize the TelegramPlugin for handling user interactions, removing the need for custom command and message handlers.
- Disabled SQLite storage in bot.py to prevent issues with large messages.
- Improved the initialization process of the CronosTransactionAnalyzer class for better integration with the Telegram bot.
- Cleaned up code by removing unnecessary comments and consolidating import statements for clarity.

Remove commented-out SQLite storage code in bot.py to streamline the codebase and prevent confusion regarding storage options. Simplify comments related to storage to enhance clarity.
1. Create a .env file with TELEGRAM_BOT_TOKEN
2. Set up your Telegram bot via @BotFather
3. Install dependencies: python-telegram-bot is already in pyproject.toml
3. Install dependencies: python-telegram-bot==22.3
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed intirely, its in the package

python-dateutil==2.9.0.post0
python-dotenv==1.0.1
python-telegram-bot==21.11.1
python-telegram-bot==22.3
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

crypto_com_agent_plugin_telegram instead of python-telegram-bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants