|
@@ -128,9 +128,9 @@ Tap the buttons below for instant access to key functions.
|
|
|
• /trades - Recent trade history
|
|
|
|
|
|
<b>🔔 Price Alerts:</b>
|
|
|
-• /alarm - List all alarms
|
|
|
+• /alarm - List all active alarms
|
|
|
• /alarm BTC 50000 - Set alarm for BTC at $50,000
|
|
|
-• /alarm BTC - Show BTC alarms only
|
|
|
+• /alarm BTC - Show all BTC alarms
|
|
|
• /alarm 3 - Remove alarm ID 3
|
|
|
|
|
|
<b>🔄 Automatic Monitoring:</b>
|
|
@@ -171,6 +171,10 @@ Type /help for detailed command information.
|
|
|
• Clean, readable layout
|
|
|
• One-tap commands
|
|
|
|
|
|
+<b>💡 Quick Access:</b>
|
|
|
+• /commands or /c - One-tap button menu for all commands
|
|
|
+• Buttons below for instant access to key functions
|
|
|
+
|
|
|
For support, contact your bot administrator.
|
|
|
""".format(
|
|
|
symbol=Config.DEFAULT_TRADING_TOKEN,
|
|
@@ -286,6 +290,57 @@ For support, contact your bot administrator.
|
|
|
)
|
|
|
|
|
|
await update.message.reply_text(help_text, parse_mode='HTML')
|
|
|
+
|
|
|
+ async def commands_command(self, update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
|
|
|
+ """Handle the /commands and /c command with quick action buttons."""
|
|
|
+ if not self.is_authorized(update.effective_chat.id):
|
|
|
+ await update.message.reply_text("❌ Unauthorized access.")
|
|
|
+ return
|
|
|
+
|
|
|
+ commands_text = """
|
|
|
+📱 <b>Quick Commands</b>
|
|
|
+
|
|
|
+Tap any button below for instant access to bot functions:
|
|
|
+
|
|
|
+💡 <b>Pro Tip:</b> These buttons work the same as typing the commands manually, but faster!
|
|
|
+ """
|
|
|
+
|
|
|
+ keyboard = [
|
|
|
+ [
|
|
|
+ InlineKeyboardButton("💰 Balance", callback_data="balance"),
|
|
|
+ InlineKeyboardButton("📈 Positions", callback_data="positions")
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ InlineKeyboardButton("📋 Orders", callback_data="orders"),
|
|
|
+ InlineKeyboardButton("📊 Stats", callback_data="stats")
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ InlineKeyboardButton("💵 Price", callback_data="price"),
|
|
|
+ InlineKeyboardButton("📊 Market", callback_data="market")
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ InlineKeyboardButton("🏆 Performance", callback_data="performance"),
|
|
|
+ InlineKeyboardButton("🔔 Alarms", callback_data="alarm")
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ InlineKeyboardButton("📅 Daily", callback_data="daily"),
|
|
|
+ InlineKeyboardButton("📊 Weekly", callback_data="weekly")
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ InlineKeyboardButton("📆 Monthly", callback_data="monthly"),
|
|
|
+ InlineKeyboardButton("🔄 Trades", callback_data="trades")
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ InlineKeyboardButton("🔄 Monitoring", callback_data="monitoring"),
|
|
|
+ InlineKeyboardButton("📝 Logs", callback_data="logs")
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ InlineKeyboardButton("⚙️ Help", callback_data="help")
|
|
|
+ ]
|
|
|
+ ]
|
|
|
+ reply_markup = InlineKeyboardMarkup(keyboard)
|
|
|
+
|
|
|
+ await update.message.reply_text(commands_text, parse_mode='HTML', reply_markup=reply_markup)
|
|
|
|
|
|
async def stats_command(self, update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
|
|
|
"""Handle the /stats command."""
|
|
@@ -737,6 +792,20 @@ For support, contact your bot administrator.
|
|
|
await self.trades_command(fake_update, context)
|
|
|
elif callback_data == "help":
|
|
|
await self.help_command(fake_update, context)
|
|
|
+ elif callback_data == "performance":
|
|
|
+ await self.performance_command(fake_update, context)
|
|
|
+ elif callback_data == "alarm":
|
|
|
+ await self.alarm_command(fake_update, context)
|
|
|
+ elif callback_data == "daily":
|
|
|
+ await self.daily_command(fake_update, context)
|
|
|
+ elif callback_data == "weekly":
|
|
|
+ await self.weekly_command(fake_update, context)
|
|
|
+ elif callback_data == "monthly":
|
|
|
+ await self.monthly_command(fake_update, context)
|
|
|
+ elif callback_data == "monitoring":
|
|
|
+ await self.monitoring_command(fake_update, context)
|
|
|
+ elif callback_data == "logs":
|
|
|
+ await self.logs_command(fake_update, context)
|
|
|
|
|
|
async def _execute_long_order(self, query, token: str, usdc_amount: float, price: float, is_limit: bool):
|
|
|
"""Execute a long order."""
|
|
@@ -1075,6 +1144,8 @@ For support, contact your bot administrator.
|
|
|
# Command handlers
|
|
|
self.application.add_handler(CommandHandler("start", self.start_command))
|
|
|
self.application.add_handler(CommandHandler("help", self.help_command))
|
|
|
+ self.application.add_handler(CommandHandler("commands", self.commands_command))
|
|
|
+ self.application.add_handler(CommandHandler("c", self.commands_command))
|
|
|
self.application.add_handler(CommandHandler("balance", self.balance_command))
|
|
|
self.application.add_handler(CommandHandler("positions", self.positions_command))
|
|
|
self.application.add_handler(CommandHandler("orders", self.orders_command))
|