editChatSubscriptionInviteLink
编辑订阅邀请链接。
返回值: 调用成功时返回 ChatInviteLink。
参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
chat_id | Integer or String | 是 | 频道 ID |
invite_link | String | 是 | 要编辑的邀请链接 |
name | String | 可选 | 新的链接名称 |
请求示例
curl
curl -s -X POST "https://api.telegram.org/bot$TOKEN/editChatSubscriptionInviteLink" \
-H "Content-Type: application/json" \
-d '{"chat_id":123456789,"invite_link":"https://t.me/+AbCdEfGhIjKl"}'
Python
import requests
TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.post(
f"https://api.telegram.org/bot{TOKEN}/editChatSubscriptionInviteLink",
json={
"chat_id": 123456789,
"invite_link": "https://t.me/+AbCdEfGhIjKl"
},
timeout=30,
)
print(resp.json())
JavaScript
const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/editChatSubscriptionInviteLink`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"chat_id": 123456789,
"invite_link": "https://t.me/+AbCdEfGhIjKl"
}),
});
console.log(await res.json());
分步教程: Telegram 机器人教程:从零创建 Telegram 机器人并发送第一条消息
相关方法
getChat获取聊天信息。getChatMember获取聊天成员信息。getChatMemberCount返回聊天成员数量。getChatAdministrators返回聊天管理员列表。setChatTitle设置聊天标题。setChatDescription设置聊天描述。setChatPhoto设置聊天头像。deleteChatPhoto删除聊天头像。setChatPermissions设置聊天权限。leaveChat退出聊天。exportChatInviteLink导出聊天的主邀请链接。createChatInviteLink创建邀请链接。