设置电报频道用户名

问题描述 投票:0回答:0

我正在尝试更新电报频道用户名。

api参考:https://core.telegram.org/method/channels.updateUsernamehttps://core.telegram.org/constructor/inputChannel

import requests

token = "mytokenhere"

data = {
    "channel": "@channeltest",
    "username": "newusername",
}
r = requests.post(f"https://api.telegram.org/bot{token}/channels.updateUsername", data=data)

print(r.text)

我收到这个错误:

{"ok":false,"error_code":404,"description":"Not Found"}

我试图更改电报频道的用户名,但它不起作用。该频道是公共的,机器人在其中具有管理员权限。得到上面提到的错误

python telegram telegram-bot python-telegram-bot telegram-api
© www.soinside.com 2019 - 2024. All rights reserved.