Available methods

unbanChatSenderChat()

Use this method to unban a previously banned channel chat in a supergroup or channel. The bot must be an administrator for this to work and must have the appropriate administrator rights. Returns True on success.

parameters

parametertyperequireddescription
chat_idnumber | stringrequiredUnique identifier for the target chat or username of the target channel in the format @username
sender_chat_idnumberrequiredUnique identifier of the target sender chat

returns

boolean

usage in yaebal

unbanChatSenderChat is directly typed on Api — call it straight off bot.api.

bot.ts
import type { UnbanChatSenderChatParams } from "@yaebal/types";

await bot.api.unbanChatSenderChat({
  chat_id: 123456789,
  sender_chat_id: 1,
} satisfies UnbanChatSenderChatParams);

context shortcut

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

context shortcut
/** Use this method to unban a previously banned channel chat in a supergroup or channel. The bot must be an administrator for this to work and must have the appropriate administrator rights. Returns *True* on success. */
ctx.unbanChatSenderChat(params: Omit<UnbanChatSenderChatParams, "chat_id">)