adding channels and groups fixing
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2025-09-05 15:47:09 +09:00
parent e7a40b4718
commit f079ad2cf7
2 changed files with 18 additions and 22 deletions

View File

@@ -10,28 +10,26 @@ async def add_group_start(update: Update, context: ContextTypes.DEFAULT_TYPE):
if context.user_data is None:
context.user_data = {}
if update.message:
await update.message.reply_text('Введите название группы (или "название ссылка" через пробел):')
await update.message.reply_text('Введите имя группы:')
return INPUT_NAME
async def input_group_name(update: Update, context: ContextTypes.DEFAULT_TYPE):
if context.user_data is None:
context.user_data = {}
text = update.message.text.strip() if update.message and update.message.text else ''
if ' ' in text:
name, link = text.split(' ', 1)
context.user_data['group_name'] = name
context.user_data['group_link'] = link
return await save_group(update, context)
else:
context.user_data['group_name'] = text
if update.message:
await update.message.reply_text('Теперь отправьте ссылку на группу:')
return INPUT_LINK
context.user_data['group_name'] = text
if update.message:
await update.message.reply_text('Теперь отправьте chat_id группы (например, -1001234567890):')
return INPUT_LINK
async def input_group_link(update: Update, context: ContextTypes.DEFAULT_TYPE):
if context.user_data is None:
context.user_data = {}
link = update.message.text.strip() if update.message and update.message.text else ''
if not link.startswith('-100'):
if update.message:
await update.message.reply_text('Ошибка: chat_id группы должен начинаться с -100. Попробуйте снова.')
return INPUT_LINK
context.user_data['group_link'] = link
return await save_group(update, context)