-
Notifications
You must be signed in to change notification settings - Fork 0
/
tgterminal.js
47 lines (41 loc) · 1.49 KB
/
tgterminal.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import TelegramBot from "node-telegram-bot-api";
import { config } from "./config.js";
const bot = new TelegramBot(config.TOKENs[2], { polling: false });
const qu1z3xId = "923690530";
async function sendDataAboutText(chatId, firstName, text) {
await bot.sendMessage(
qu1z3xId,
`<b><a href="https://t.me/digmathbot">🧮</a> #digmath | Text\n\n<a href="tg://user?id=${chatId}">${firstName}</a> | </b><code>${chatId}</code>\n<blockquote><i>${text}</i></blockquote>`,
{
parse_mode: "html",
disable_notification: true,
disable_web_page_preview: true,
}
);
}
async function sendDataAboutButton(chatId, firstName, data) {
await bot.sendMessage(
qu1z3xId,
`<b><a href="https://t.me/digmathbot">🧮</a> #digmath | Button\n\n<a href="tg://user?id=${chatId}">${firstName}</a> | </b><code>${chatId}</code>\n<blockquote><i>[${data}]</i></blockquote>`,
{
parse_mode: "html",
disable_notification: true,
disable_web_page_preview: true,
}
);
}
async function sendDataAboutError(chatId, firstName, text) {
await bot.sendMessage(
qu1z3xId,
`<b><a href="https://t.me/digmathbot">🧮</a> #digmath | ⛔️ ERROR ⛔️\n\n<a href="tg://user?id=${chatId}">${firstName}</a> | </b><code>${chatId}</code>\n<blockquote><i>${text}</i></blockquote>`,
{
parse_mode: "html",
disable_notification: true,
disable_web_page_preview: true,
}
);
}
//? ЭКСПОРТ ФУНКЦИЙ В index.js
export { sendDataAboutButton };
export { sendDataAboutError };
export { sendDataAboutText };