0
Send a Text Message or Reply
One script reply has been approved by the moderators Verified
Created by paulpragpaymn 683 days ago Viewed 8704 times
1
Submitted by adam186 Deno
Verified 498 days ago
1
import { Telegram } from "npm:telegraf@4.11";
2

3
type Telegram = {
4
  token: string;
5
};
6
export async function main(
7
  auth: Telegram,
8
  chat_id: string | number,
9
  text: string,
10
  reply_to_message_id?: number,
11
) {
12
  const client = new Telegram(auth.token);
13
  return await client.sendMessage(chat_id, text, {
14
    reply_to_message_id,
15
  });
16
}
17