@@ -964,11 +964,12 @@ async def _handle_add_domain_input(self, update: Update, domain_input: str, user
964964 # 根据检查结果决定下一步
965965 keyboard = []
966966
967+ should_reject = self .domain_checker .should_reject (check_result )
967968 if self .domain_checker .should_add_directly (check_result ):
968969 # 符合条件,提供添加选项
969970 keyboard .append ([InlineKeyboardButton ("✅ 确认添加" , callback_data = "confirm_add_yes" )])
970971 keyboard .append ([InlineKeyboardButton ("❌ 取消添加" , callback_data = "confirm_add_no" )])
971- elif self . domain_checker . should_reject ( check_result ) :
972+ elif should_reject :
972973 # 不符合条件,拒绝添加
973974 result_text += "\n ❌ **不符合添加条件,无法添加到直连规则。**"
974975 if self .is_admin (user_id ):
@@ -989,6 +990,9 @@ async def _handle_add_domain_input(self, update: Update, domain_input: str, user
989990
990991 reply_markup = InlineKeyboardMarkup (keyboard )
991992 await processing_msg .edit_text (result_text , reply_markup = reply_markup , parse_mode = 'Markdown' )
993+
994+ if should_reject :
995+ self .set_user_state (user_id , "waiting_add_domain" )
992996
993997 except Exception as e :
994998 logger .error (f"添加域名输入处理失败: { e } " )
@@ -1026,7 +1030,8 @@ async def _handle_add_domain_callback(self, query, user_id: int, data: str):
10261030 # 根据检查结果决定下一步
10271031 keyboard = []
10281032
1029- if not self .domain_checker .should_reject (check_result ):
1033+ should_reject = self .domain_checker .should_reject (check_result )
1034+ if not should_reject :
10301035 keyboard .append ([InlineKeyboardButton ("✅ 确认添加" , callback_data = "confirm_add_yes" )])
10311036 keyboard .append ([InlineKeyboardButton ("❌ 取消添加" , callback_data = "confirm_add_no" )])
10321037 else :
@@ -1044,6 +1049,9 @@ async def _handle_add_domain_callback(self, query, user_id: int, data: str):
10441049
10451050 reply_markup = InlineKeyboardMarkup (keyboard )
10461051 await query .edit_message_text (result_text , reply_markup = reply_markup , parse_mode = 'Markdown' )
1052+
1053+ if should_reject :
1054+ self .set_user_state (user_id , "waiting_add_domain" )
10471055
10481056 except Exception as e :
10491057 logger .error (f"处理添加域名回调失败: { e } " )
0 commit comments