0
Send a Photo
One script reply has been approved by the moderators Verified
Created by paulys8ty1 683 days ago Viewed 4576 times
0
Submitted by adam186 Deno
Verified 499 days ago
1
import { Telegram } from "npm:telegraf@4.11";
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