简体   繁体   English

电报机器人 api 方法 revokeChatInviteLink

[英]Telegram bot api method revokeChatInviteLink

i have one problem when i develop my bot.当我开发我的机器人时,我遇到了一个问题。 I need to revoke invite link that i created by my bot.我需要撤销我的机器人创建的邀请链接。 And i use your telegram bot api.我使用你的电报机器人 api。 For example, i created next url and try to use it: https://api.telegram.org/bot{token}/revokeChatInviteLink?chat_id={chatId}&invite_link={inviteLink}例如,我创建了下一个 url 并尝试使用它: https://api.telegram.org/bot{token}/revokeChatInviteLink?chat_id={chatId}&invite_link={inviteLink}

(I'm sure that my token, chat_id and inviteLink are correct) But this don't work and return me error 400. For example in value inviteLink i have string like that: https://t.me/+OlaTFdG1UftkOTgy (我确定我的令牌、chat_id 和邀请链接是正确的)但这不起作用并返回错误 400。例如在值邀请链接中我有这样的字符串: https://t.me/+OlaTFdG1UftkOTgy

What i do wrong?我做错了什么? (Also method editChatInviteLink don't work, i use it in the same way. I saw that method creatChatInviteLink return is_revoked = false, but i don't know how to make it true) (方法editChatInviteLink也不起作用,我以同样的方式使用它。我看到方法creatChatInviteLink返回is_revoked = false,但我不知道如何使它成为真的)

I do it in C#, but I would be grateful for help in any other language.我在 C# 中执行此操作,但我将不胜感激任何其他语言的帮助。

https://core.telegram.org/bots/api#revokechatinvitelink https://core.telegram.org/bots/api#revokechatinvitelink

Use this method to revoke an invite link created by the bot.使用此方法撤销机器人创建的邀请链接。 If the primary link is revoked, a new link is automatically generated.如果主链接被撤销,则会自动生成一个新链接。 The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights.机器人必须是聊天中的管理员才能正常工作,并且必须具有适当的管理员权限。 Returns the revoked invite link as ChatInviteLink object.将撤销的邀请链接返回为 ChatInviteLink object。

You get 400 error.你得到 400 错误。 Ok, but what is the description of the error?好的,但是错误的描述是什么? Too less infomration to understand.信息太少,无法理解。

If it doesn't find the chat, have you putted the '-100' before chat id?如果它没有找到聊天,你是否在聊天 id 前加上了“-100”? Channels and supergroup have this value before chat id. Channels 和 supergroup 在聊天 id 之前有这个值。 You can also use the bot api to finde the correct chat id.您还可以使用机器人 api 来查找正确的聊天 ID。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM