【问题标题】:How to solve floodwait error await result如何解决floodwait错误等待结果
【发布时间】:2019-10-16 04:39:52
【问题描述】:
[12:36:26] Joining @acharaexchange...
ERROR:telethon.client.updates:Unhandled exception on join_start
Traceback (most recent call last):
  File "/storage/emulated/0/yul/msg2/telethon/client/updates.py", line 284, in _dispatch_update
    await callback(event)
  File "join.py", line 83, in join_start
    await client(JoinChannelRequest(channel_name))
  File "/storage/emulated/0/yul/msg2/telethon/client/users.py", line 48, in __call__
    result = await future
telethon.errors.rpcerrorlist.FloodWaitError: A wait of 205 seconds is required

任何人都可以帮助我如何解决它,如果出现这种情况,我想做这个,如何让它重新启动或让时间睡眠并自动继续

我的脚本是这样的

加入频道

@client.on(events.NewMessage(chats=dogeclick_channel, incoming=True))
async def join_start(event):
    message = event.raw_text
    if 'You must join' in message:  
        channel_name = re.search(r'You must join @(.*?) to earn', message).group(1)
        print_msg_time(f'Joining @{channel_name}...')

        # joining
        await client(JoinChannelRequest(channel_name))
        print_msg_time(f'Verifying...')

【问题讨论】:

    标签: python python-3.x python-2.7


    【解决方案1】:

    试试这个

    async def join_start(event):
        if True :
            try:
                message = event.raw_text
                if 'You must join' in message:  
                    channel_name = re.search(r'You must join @(.*?) to earn', message).group(1)
                    print_msg_time(f'Joining @{channel_name}...')
                    hidden = random. randrange(20, 45)
                    print_msg_time('Sending /join command')
                    time.sleep(hidden)
                    await client(JoinChannelRequest(channel_name))
                    # Join the channel
                    print_msg_time(f'Verifying...')
                    
                    # Clicks the joined
                    await client(GetBotCallbackAnswerRequest(
                        peer=url_channel,
                        msg_id=event.message.id,
                        data=event.message.reply_markup.rows[0].buttons[1].data
                    ))
            except errors.FloodWaitError as e:
                print('Flood wait for ', e.seconds)
                exit
    

    【讨论】:

      猜你喜欢
      • 2011-09-03
      • 2020-12-11
      • 2019-03-06
      • 1970-01-01
      • 2017-04-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-11-09
      相关资源
      最近更新 更多