Copperx Telegram Bot
  1. callbacks
Copperx Telegram Bot
  • index
  • readme
  • setup
  • development
  • api-integration
  • troubleshooting
  • architechture
  • callbacks
    • index (all callbacks)
    • wallet
    • transfer-callback
    • send
  • commands
    • help
    • index(all commands)
    • login
    • logout
    • start
    • transfer
    • transfer
  • notifications
    • deposite-notification
  • Register Telegram Webhook to your url
    POST
  1. callbacks

index (all callbacks)

Callback Reference#

This section provides a comprehensive reference for all callback operations available in the CopperX Payout Bot. Callbacks are used to handle user interactions with inline keyboard buttons.

Callback System Overview#

The callback system in the CopperX Payout Bot is designed to handle user interactions with inline keyboard buttons. When a user clicks a button, Telegram sends a callback_query update to the bot's webhook. The bot extracts the callback_data and routes it to the appropriate handler.
The callback system supports:
Simple callbacks (e.g., login)
Parameterized callbacks (e.g., wallet_details:12345)
Dynamic callback generation

Callback Architecture#

Callbacks are processed through the following components:
1.
Webhook Handler: Receives the callback query from Telegram
2.
Callback Router: Extracts the callback data and routes to the appropriate handler
3.
Callback Handlers: Process specific callbacks and generate responses
The main callback router is implemented in src/bot/operations/callback.operations.ts.

Available Callbacks#

CallbackDescriptionAuthentication RequiredKYC Required
loginInitiate login processNoNo
helpShow help messageNoNo
check_verificationCheck KYC statusYesNo
wallet_details:idShow wallet detailsYesYes
wallet_set_default:idSet default walletYesYes
wallet_deposit:idShow deposit addressYesYes
wallet_all_balancesShow all wallet balancesYesYes
wallet_backReturn to wallet listYesYes
wallet_createInitiate wallet creationYesYes
transfer_listShow transfer listYesYes
transfer_details:idShow transfer detailsYesYes
transfer_sendInitiate send processYesYes
transfer_withdrawInitiate withdraw processYesYes
transfer_batchInitiate batch transferYesYes
transfer_offrampInitiate offramp transferYesYes
transfer_next_page:pageGo to next page of transfersYesYes
transfer_prev_page:pageGo to previous page of transfersYesYes
transfer_backReturn to transfer menuYesYes
send_by_emailSend by emailYesYes
send_by_walletSend by wallet addressYesYes
send_confirmConfirm transferYesYes
send_cancelCancel transferYesYes
transfer_currency:currencySelect currencyYesYes
transfer_purpose:purposeSelect purposeYesYes

Callback Implementation#

The main callback router is implemented as follows:

Callback Details#

Each callback category has its own detailed documentation:
Login Callbacks
Wallet Callbacks
Transfer Callbacks
Send Callbacks
Verification Callbacks

Callback Registration#

Standard callbacks are registered in the callbackOperations object:

Callback Data Format#

Callbacks follow these formats:
Simple callback: callback_name
Parameterized callback: callback_name:parameter1:parameter2
The parameters are extracted using:

Best Practices#

Use clear, descriptive names for callbacks
Keep callback data short to respect Telegram's 64-byte limit
Use parameterized callbacks for dynamic content
Handle authentication and KYC checks in each callback handler
Provide clear error messages if a callback fails
Always include a way to navigate back or cancel an operation
Modified at 2025-03-23 17:12:30
Previous
architechture
Next
wallet
Built with