Kick a Chat Member ( telegram)
One script reply has been approved by the moderators Verified

Created by saskiacimex 296 days ago Viewed 52 times 0 Points

No comments yet

Login to be able to comment
Points: 0
deno
One script reply has been approved by the moderators
Ap­pro­ved
import * as wmill from "https://deno.land/x/windmill@v1.70.1/mod.ts"
import { Telegram } from "npm:telegraf@4.11"

/** 
 * @param until_date Unix time. If user is banned for more than 
 * 366 days or less than 30 seconds from the current time they 
 * are considered to be banned forever.
 * 
 * @param revoke_messages If `true` then the banned user's messages 
 * will be deleted from the chat.
 */
export async function main(
  auth: wmill.Resource<"telegram">,
  chat_id: string,
  user_id: number,
  until_date?: number,
  revoke_messages?: boolean | undefined
) {
  const client = new Telegram(auth.token)
  return await client.banChatMember(
    chat_id,
    user_id,
    until_date || undefined,
    {
      revoke_messages
    }
  )
}

Submitted by adam186 111 days ago

Edited 29 days ago

No comments yet

Login to be able to comment