• Как мне войти в телеграмм аккаунт через свой софт?

    @andrew053 Автор вопроса
    Алан Гибизов, На данный момент, у меня формата стандартный 12345, вот джава скрипт, перезапуск кода я вырежу, оставлю один, когда я авторизовался чепез консоль все работало, а когда начал через свой веб интерфейс, он начал выдавать ошибку о просрочке кода
    let phone_code_hash = null;
    
    async function getCode(){
        const api_id = document.getElementById('api_id').value;
        const api_hash = document.getElementById('api_hash').value;
        const phone = document.getElementById('phone').value;
        const proxy = document.getElementById('proxy').value;
    
        const response = await eel.add_account(api_id, api_hash, phone, proxy)();
    
        if (response && response[0] === 'code_required') {
            document.getElementById('code').disabled = false;
            document.getElementById('password').disabled = false;
            phone_code_hash = response[1]; // Сохраняем phone_code_hash
            alert('Enter the code from Telegram.');
        } else {
            alert('Error sending request to get code. Check the entered data.');
        }
    }
    
    async function submitForm() {
        const api_id = document.getElementById('api_id').value;
        const api_hash = document.getElementById('api_hash').value;
        const phone = document.getElementById('phone').value;
        const proxy = document.getElementById('proxy').value;
        const code = document.getElementById('code').value;
        const password = document.getElementById('password').value;
    
        const response = await eel.add_account(api_id, api_hash, phone, proxy, code, password, phone_code_hash)();
    
        if (Array.isArray(response) && response[0] === 'code_required') {
            phone_code_hash = response[1];
            alert('Code required. Check your phone and enter the code in the form.');
            document.getElementById('submit_button').onclick = function() { submitForm(); };
        } else if (!response) {
            alert('Authorisation Error. Check the entered data.');
        } else {
            alert('Authorization successful.');
            
       }
    }
  • Как мне сделать чтобы бот пересылал сообщения?

    @andrew053 Автор вопроса
    тоесть мне просто убрать parse? если да то я заменил, бот в тупую не видит сообщения, сколько гайдов пересмотрел и перечитал по этому поводу, везде отмечается что бот тоже читает сообщение, а у меня только 1 глазок на сообщении, что я прочитал и все
  • Как мне сделать чтобы бот пересылал сообщения?

    @andrew053 Автор вопроса
    @bot.message_handler(content_types=['text', 'photo', 'video'])
    def process_text(message):
        if message.text == 'Добавить источник группу':
            bot.send_message(message.chat.id, 'Введите название через @ , которую нужно добавить в источник:')
            bot.register_next_step_handler(message, process_group_link_step)
    
        elif message.text == 'Добавить целевую группу':
            bot.send_message(message.chat.id, 'Введите название через @, которую нужно добавить в целевые:')
            bot.register_next_step_handler(message, process_target_group_link_step)
    
        elif message.text == 'Список групп':
            bot.send_message(message.chat.id, f"Группа источник:\n{source_groups}\n\nЦелевые группы:\n{target_groups}")
        elif message.text == 'Удалить группу':
            bot.send_message(message.chat.id, 'Введите ID группы, которую нужно удалить:')
            bot.register_next_step_handler(message, process_remove_group_step)
    
        else:
            chat_id = message.chat.id
            if chat_id in source_groups:
                for target_group_id in target_groups:
                    if message.content_type == 'text':
                        caption_entities = message.parse_entities(types.MessageEntity)
                        bot.send_message(target_group_id, text=message.text, entities=caption_entities)
                    elif message.content_type == 'photo':
                        caption_entities = message.parse_entities(types.MessageEntity)
                        bot.send_photo(target_group_id, photo=message.photo[-1].file_id, caption=message.caption,
                                       caption_entities=caption_entities)
                    elif message.content_type == 'video':
                        caption_entities = message.parse_entities(types.MessageEntity)
                        bot.send_video(target_group_id, video=message.video.file_id, caption=message.caption,
                                       caption_entities=caption_entities)
            elif chat_id in target_groups:
                pass
  • Как мне сделать чтобы бот пересылал сообщения?

    @andrew053 Автор вопроса
    вот я обьеденил в один обработчик код и он не пересылает, бот даже сообщения не видит в source_group и ошибок в консоле нет

    @bot.message_handler(content_types=['text', 'photo', 'video'])
    def process_text(message):
    if message.text == 'Добавить источник группу':
    bot.send_message(message.chat.id, 'Введите название через @ , которую нужно добавить в источник:')
    bot.register_next_step_handler(message, process_group_link_step)

    elif message.text == 'Добавить целевую группу':
    bot.send_message(message.chat.id, 'Введите название через @, которую нужно добавить в целевые:')
    bot.register_next_step_handler(message, process_target_group_link_step)

    elif message.text == 'Список групп':
    bot.send_message(message.chat.id, f"Источники новостей:\n{source_groups}\n\nЦелевые группы:\n{target_groups}")
    elif message.text == 'Удалить группу':
    bot.send_message(message.chat.id, 'Введите ID группы, которую нужно удалить:')
    bot.register_next_step_handler(message, process_remove_group_step)

    else:
    chat_id = message.chat.id
    if chat_id in source_groups:
    for target_group_id in target_groups:
    if message.content_type == 'text':
    caption_entities = message.parse_entities(types.MessageEntity)
    bot.send_message(target_group_id, text=message.text, entities=caption_entities)
    elif message.content_type == 'photo':
    caption_entities = message.parse_entities(types.MessageEntity)
    bot.send_photo(target_group_id, photo=message.photo[-1].file_id, caption=message.caption,
    caption_entities=caption_entities)
    elif message.content_type == 'video':
    caption_entities = message.parse_entities(types.MessageEntity)
    bot.send_video(target_group_id, video=message.video.file_id, caption=message.caption,
    caption_entities=caption_entities)
    elif chat_id in target_groups:
    pass
  • Как мне сделать чтобы бот пересылал сообщения?

    @andrew053 Автор вопроса
    Проблема в другом, я пробовал все пересылать и бот вообще сообщения не видит, насколько я понимаю что отмечаться в телеграмме должны все кто видел и даже бот, но он не видит их