Available methods

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.

parameters

parametertyperequireddescription
chat_idnumber | stringrequiredUnique identifier of the target chat or username of the target channel in the format @username
invite_linkstringrequiredThe invite link to revoke

returns

ChatInviteLink

usage in yaebal

not (yet) hard-typed on Api — call it through the generic .call<T>() escape hatch documented in @yaebal/types.

bot.ts
import type { ChatInviteLink, RevokeChatInviteLinkParams } from "@yaebal/types";

await bot.api.call<ChatInviteLink>("revokeChatInviteLink", {
  chat_id: 123456789,
  invite_link: "...",
} satisfies RevokeChatInviteLinkParams);

context shortcut

also available as ctx.revokeChatInviteLink() on 16 context types — see @yaebal/contexts.

context shortcut
/** 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](https://core.telegram.org/bots/api/#chatinvitelink) object. */
ctx.revokeChatInviteLink(params: Omit<RevokeChatInviteLinkParams, "chat_id">)