0

Send a Photo

by
Published Jun 6, 2022
Script telegram Verified

The script

Submitted by hugo989 Bun
Verified 6 days ago
1
import { Telegram as Telegraf } from "[email protected]";
2
/**
3
 * @param photo The path or URL to the image.
4
 */
5
type Telegram = {
6
  token: string;
7
};
8
export async function main(
9
  auth: Telegram,
10
  chat_id: string | number,
11
  photo: string,
12
  reply_to_message_id?: number,
13
) {
14
  const client = new Telegraf(auth.token);
15
  return await client.sendPhoto(chat_id, photo, {
16
    reply_to_message_id,
17
  });
18
}
19

Other submissions
  • Submitted by adam186 Deno
    Created 398 days ago
    1
    import { Telegram } from "npm:[email protected]";
    2
    /**
    3
     * @param photo The path or URL to the image.
    4
     */
    5
    type Telegram = {
    6
      token: string;
    7
    };
    8
    export async function main(
    9
      auth: Telegram,
    10
      chat_id: string | number,
    11
      photo: string,
    12
      reply_to_message_id?: number,
    13
    ) {
    14
      const client = new Telegram(auth.token);
    15
      return await client.sendPhoto(chat_id, photo, {
    16
        reply_to_message_id,
    17
      });
    18
    }
    19