| from telegram import Update, InlineKeyboardButton, InlineKeyboardMarkup |
| from telegram.ext import ContextTypes |
| import logging |
|
|
| logger = logging.getLogger(__name__) |
|
|
| class MonitorHandlers: |
| def __init__(self, bot): |
| self.bot = bot |
|
|
| async def handle_country_selection(self, query, context): |
| """Handle country selection for monitoring""" |
| keyboard = [ |
| [InlineKeyboardButton("πΈπ¦ Saudi Arabia", callback_data='monitor_country_SA')], |
| [InlineKeyboardButton("π¦πͺ UAE", callback_data='monitor_country_AE')], |
| [InlineKeyboardButton("πΆπ¦ Qatar", callback_data='monitor_country_QA')], |
| [InlineKeyboardButton("β¬
οΈ Back", callback_data='start_monitoring')] |
| ] |
| |
| reply_markup = InlineKeyboardMarkup(keyboard) |
| await query.edit_message_text( |
| "π Select a country to monitor events from:", |
| reply_markup=reply_markup |
| ) |
|
|
| async def handle_date_selection(self, query, context): |
| """Handle date filter selection for monitoring""" |
| keyboard = [ |
| [InlineKeyboardButton("βοΈ Today", callback_data='monitor_date_today')], |
| [InlineKeyboardButton("ποΈ Tomorrow", callback_data='monitor_date_tomorrow')], |
| [InlineKeyboardButton("π
This Week", callback_data='monitor_date_this_week')], |
| [InlineKeyboardButton("β¬
οΈ Back", callback_data='start_monitoring')] |
| ] |
| |
| reply_markup = InlineKeyboardMarkup(keyboard) |
| await query.edit_message_text( |
| "π
Select a date filter for monitoring:", |
| reply_markup=reply_markup |
| ) |
|
|
| async def handle_category_selection(self, query, context): |
| """Handle category selection for monitoring""" |
| keyboard = [ |
| [InlineKeyboardButton("π Offers", callback_data='monitor_category_offers')], |
| [InlineKeyboardButton("β½ Sports", callback_data='monitor_category_sports-events')], |
| [InlineKeyboardButton("π Theater", callback_data='monitor_category_theater-and-performing-arts')], |
| [InlineKeyboardButton("β¬
οΈ Back", callback_data='start_monitoring')] |
| ] |
| |
| reply_markup = InlineKeyboardMarkup(keyboard) |
| await query.edit_message_text( |
| "π― Select a category to monitor:", |
| reply_markup=reply_markup |
| ) |
|
|
| async def handle_price_range(self, query, context): |
| """Handle price range selection for monitoring""" |
| |
| await query.edit_message_text( |
| "π° Please enter the price range in the format:\n" |
| "min-max\n" |
| "Example: 100-500\n" |
| "Or enter 'any' for no price filter" |
| ) |
| context.user_data['awaiting_price_range'] = True |