Telegram Bot - Cryptoscan
Last updated
Last updated
@cryptoscan/cryptobot-tg is a Telegram bot that allows users to interact with cryptocurrency data. The bot provides the ability to sort and filter data by various parameters, as well as track changes in real-time.
Clone the repository:
Navigate to the project directory:
Install dependencies:
Create a .env
file based on .env.example
and specify the necessary environment variables:
BOT_TOKEN
: This is the API key for your Telegram bot. It is required to authenticate and interact with the Telegram API.
WEBSOCKET
: Set this to 1
to use WebSockets for real-time data updates, or 0
to use HTTP.
These configurations are crucial for the bot's operation, determining how it connects to Telegram and whether it uses WebSockets or HTTP for data communication.
To start the bot, use the command:
After starting the bot, you can interact with it via Telegram:
Start the bot with /start
Choose between:
📋 List of Trackings - View and manage existing configurations
➕ Add New Tracking - Create a new configuration
When creating a new tracking:
Select a data type (e.g., types, arbitrage, contracts, networks)
Choose fields for sorting/filtering (e.g., id, type, exchange, symbol, etc.)
Select actions for the field:
Sort Descending
Sort Ascending
Minimum Filter
Maximum Filter
Change %
For Change %, select an interval:
5 seconds
10 seconds
15 seconds
30 seconds
1 minute
1 hour
Choose to continue adding more filters or save
When saving:
Choose whether to use AI for message processing
Optionally set a custom message template
Select destination (private messages or channel)
Set message suffix
Set message delay (timeout)
Name your configuration
Additional Features:
/send
command to manually send messages using saved configurations
Toggle configurations on/off
Edit existing configurations
Delete configurations
The option sets in the bot are used to customize how data is retrieved and displayed. They allow users to:
Select Data Types: Choose the type of cryptocurrency data to interact with, such as types
, arbitrage
, contracts
, networks
.
Choose Fields: Specify which fields to sort or filter:
id
: Unique identifier for the data entry.
type
: The type of
@cryptoscan/cryptobot-tg is a Telegram bot that allows users to interact with cryptocurrency data. The bot provides the ability to sort and filter data by various parameters, as well as track changes in real-time.
Clone the repository:
Navigate to the project directory:
Install dependencies:
Create a .env
file based on .env.example
and specify the necessary environment variables:
BOT_TOKEN
: This is the API key for your Telegram bot. It is required to authenticate and interact with the Telegram API.
WEBSOCKET
: Set this to 1
to use WebSockets for real-time data updates, or 0
to use HTTP.
These configurations are crucial for the bot's operation, determining how it connects to Telegram and whether it uses WebSockets or HTTP for data communication.
To start the bot, use the command:
After starting the bot, you can interact with it via Telegram. The command flow is as follows:
Start the bot with the command /start
.
The bot will display buttons for selecting a data type, such as types
, arbitrage
, contracts
, networks
.
Next, choose a field for sorting or filtering, such as id
, type
, exchange
, symbol
, name
, price
, volume
, createdAt
.
Then, select an action: sorting, filtering, or change percentage. Options include:
For numbers: sort desc
, sort asc
, filter min
, filter max
, change %
.
For strings: filter
.
Sorting is available for both types.
If change %
is selected, choose an interval: change5s
, 10s
, 15s
, 30s
, 1 min
, 1 hour
.
Finally, decide whether to continue adding options or save the configuration. The bot will then start listening for changes.
The bot supports AI-powered message processing using OpenAI's GPT. When creating a configuration, you can:
Enable AI processing
Provide a custom prompt for message formatting
The bot will process all messages through the AI before sending
This allows for:
Natural language reformatting
Content enhancement
Custom message styling
Each configuration supports several message formatting options:
Custom Templates: Use your own template files for message formatting
Message Suffix: Add custom text at the end of each message
Message Delay: Set a custom delay (timeout) before sending messages
Destination Options:
Private Messages: Send to individual users
Channel Messages: Send to Telegram channels
Supports both channel usernames (@channel) and channel IDs
Requires bot to be channel admin
Sorting: Ability to sort data in ascending or descending order.
Filtering: Set minimum and maximum values for data filtering.
Change Tracking: Ability to track data changes in real-time.
If you want to contribute to the project, please fork the repository and submit a pull request with your changes.
This project is licensed under the MIT License.