无需等待25分钟即可申请电报用户名

2024-06-28 11:08:57 发布

您现在位置:Python中文网/ 问答频道 /正文

我想申请一个电报用户名。在做一些测试时,我意识到我最近无法声明“免费”的用户名,因为我收到了以下错误:

A wait of 1500 seconds is required (caused by UpdateUsernameRequest)

我想问一下,有没有一种方法可以“绕过”25分钟的等待延迟,或者在不等待25分钟的情况下立即更新您的用户名。 这是bot的源代码:

from telethon.tl.functions.account import UpdateUsernameRequest
from telethon import TelegramClient

api_id = 000000
api_hash = 'xxxxxxxx'
client = TelegramClient('session', api_id, api_hash)

async def main():
    await client(UpdateUsernameRequest('username'))
    
with client:
    client.loop.run_until_complete(main())

提前谢谢


Tags: fromimportclientapiid声明main错误