Spaces:
Reooiq
/
Paused

Reooiq96 commited on
Commit
608dba2
ยท
verified ยท
1 Parent(s): 93e2add

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +45 -61
index.js CHANGED
@@ -3,18 +3,16 @@ const axios = require('axios');
3
  const dns = require('dns');
4
  const http = require('http');
5
 
6
- // --- System Configuration ---
7
  const TELEGRAM_TOKEN = process.env.TELEGRAM_TOKEN;
8
  const TELEGRAM_CHAT_ID = process.env.TELEGRAM_CHAT_ID;
9
  const SESSION_ID = process.env.SESSION_ID;
10
- const FIXED_COUNTRY = "Iraq";
11
-
12
- // Manual accounts list for monitoring
13
- const ACCOUNTS_TO_WATCH = ['ah_md107', '3z1199'];
14
 
15
  dns.setServers(['8.8.8.8']);
16
 
17
- // --- Formatting Functions ---
18
  function formatK(num) {
19
  if (num >= 1000000) return (num / 1000000).toFixed(1) + 'M';
20
  if (num >= 1000) return (num / 1000).toFixed(1) + 'K';
@@ -22,21 +20,22 @@ function formatK(num) {
22
  }
23
 
24
  function getBaghdadTime() {
25
- return new Intl.DateTimeFormat('en-US', { timeZone: 'Asia/Baghdad', dateStyle: 'medium', timeStyle: 'medium', hour12: true }).format(new Date());
26
  }
27
 
 
28
  function formatDuration(totalMinutes) {
29
- if (totalMinutes < 60) return `${totalMinutes} Minutes`;
30
  const hours = Math.floor(totalMinutes / 60);
31
  const minutes = totalMinutes % 60;
32
- return minutes > 0? `${hours} Hours and ${minutes} Minutes` : `${hours} Hours`;
33
  }
34
 
35
  async function sendToTelegram(text, photoUrl = null, targetLink = null) {
36
  try {
37
  const addrs = await new Promise(r => dns.resolve4('api.telegram.org', (e, a) => r(a)));
38
- const baseUrl = `https://${addrs}/bot${TELEGRAM_TOKEN}`;
39
- let formattedText = targetLink? `<a href="${targetLink}">โ€โ€โ€Ž โ€Ž</a>` + text : text;
40
  const payload = { chat_id: TELEGRAM_CHAT_ID, parse_mode: 'HTML', disable_web_page_preview: false };
41
 
42
  if (photoUrl) {
@@ -48,19 +47,19 @@ async function sendToTelegram(text, photoUrl = null, targetLink = null) {
48
  await axios.post(`${baseUrl}/sendMessage`, payload, { headers: { 'Host': 'api.telegram.org' } });
49
  }
50
  } catch (e) {
51
- console.log("Telegram Error");
52
  }
53
  }
54
 
55
  async function startRadar(username) {
56
  let user = username.trim();
57
- const primaryOptions = { processInitialData: true, enableWebsocketUpgrade: true, sessionId: SESSION_ID, clientParams: { "app_language": "en-US", "device_platform": "web", "tt_target_idc": "useast1a" } };
58
- const fallbackOptions = { processInitialData: true, enableWebsocketUpgrade: true, sessionId: SESSION_ID, clientParams: { "app_language": "en-US", "device_platform": "web" } };
59
 
60
  let connection = new WebcastPushConnection(user, primaryOptions);
61
  let highestHundred = 0, maxViewers = 0, totalLikes = 0, totalShares = 0;
62
  let giftersMap = {}, commentersMap = {}, adminsSeen = new Set();
63
- let bestGift = { name: "None", cost: 0, sender: "", icon: "" };
64
  let startTime = null;
65
  let fastCommentCounter = {};
66
  let alertedComments = new Set();
@@ -69,13 +68,13 @@ async function startRadar(username) {
69
  const state = await connection.connect();
70
  handleConnectionSuccess(state);
71
  } catch (err) {
72
- console.log(`Connection failed for ${user}, trying fallback...`);
73
  connection = new WebcastPushConnection(user, fallbackOptions);
74
  try {
75
  const state = await connection.connect();
76
  handleConnectionSuccess(state);
77
  } catch (fallbackErr) {
78
- console.log(`Fatal: All connections failed for ${user}`);
79
  setTimeout(() => startRadar(user), 60000);
80
  return;
81
  }
@@ -83,44 +82,29 @@ async function startRadar(username) {
83
 
84
  function handleConnectionSuccess(state) {
85
  startTime = new Date();
86
- let statusEmoji = state.roomInfo.live_room_mode === 4? "๐ŸŽค" : "๐Ÿ”ด";
87
- let statusText = state.roomInfo.live_room_mode === 4? "Alert: Guest is Live!" : "Live Stream Started";
88
  let liveLink = `https://www.tiktok.com/@${user}/live`;
89
  if (state.roomInfo.live_room_mode === 4 && state.roomInfo.owner) {
90
  liveLink = `https://www.tiktok.com/@${state.roomInfo.owner.uniqueId}/live`;
91
  }
92
- let msg = `${statusEmoji} <b>${statusText}</b>\n` +
93
- `โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€\n` +
94
- `๐Ÿ‘ค <b>Account:</b> <code>${user}</code>\n` +
95
- `๐ŸŒ <b>Country:</b> ${FIXED_COUNTRY}\n` +
96
- `๐Ÿ“… <b>Time:</b> <code>${getBaghdadTime()}</code>\n` +
97
- `โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€\n` +
98
- `๐Ÿ”— <b>Link:</b> <a href="${liveLink}">${liveLink}</a>`;
99
  sendToTelegram(msg);
100
  }
101
 
102
- // Track Likes and Shares (2026 Update)
103
- connection.on('like', (data) => { totalLikes = data.totalLikeCount; });
104
  connection.on('social', (data) => { if (data.displayType && data.displayType.includes('share')) totalShares++; });
105
 
106
- // Handle All Boxes and Interaction Bags
107
  const handleBox = (data, type) => {
108
- let coins = data.coins |
109
-
110
- | data.diamonds |
111
- | data.amount |
112
- | "N/A";
113
- let sender = data.nickname |
114
-
115
- | (data.user && data.user.nickname) |
116
- | 'Unknown';
117
- sendToTelegram(`๐Ÿ’ฐ <b>${type} Alert!</b>\n๐Ÿ‘ค Live: @${user}\n๐ŸŽ From: <b>${sender}</b>\n๐Ÿ’Ž Value: <b>${coins} Coins</b>`);
118
  };
119
 
120
- connection.on('treasureBox', (data) => handleBox(data, "Treasure Bag"));
121
- connection.on('luckyBox', (data) => handleBox(data, "Lucky Box"));
122
- connection.on('chest', (data) => handleBox(data, "Interaction Bag"));
123
- connection.on('envelope', (data) => handleBox(data, "Interaction Bag"));
124
 
125
  connection.on('chat', (data) => {
126
  let text = data.comment.trim();
@@ -128,12 +112,12 @@ async function startRadar(username) {
128
  if (!commentersMap[data.userId]) commentersMap[data.userId] = { name: data.nickname, count: 0 };
129
  commentersMap[data.userId].count++;
130
  if (text.length > 1) {
131
- if (!fastCommentCounter[text]) fastCommentCounter[text] =;
132
  fastCommentCounter[text].push(now);
133
  fastCommentCounter[text] = fastCommentCounter[text].filter(ts => now - ts < 60000);
134
- if (fastCommentCounter[text].length >= 100 &&!alertedComments.has(text)) {
135
  alertedComments.add(text);
136
- sendToTelegram(`โš ๏ธ <b>Spam Alert @${user}!</b>\n๐Ÿ’ฌ "<code>${text}</code>"\n๐Ÿ”ฅ Repeated 100 times in 1 min!`);
137
  setTimeout(() => alertedComments.delete(text), 300000);
138
  }
139
  }
@@ -146,20 +130,21 @@ async function startRadar(username) {
146
  if (currentHundred >= 100 && currentHundred > highestHundred) {
147
  highestHundred = currentHundred;
148
  let liveLink = `https://www.tiktok.com/@${user}/live`;
149
- sendToTelegram(`๐Ÿš€ <b>Achievement @${user}:</b> Reached <code>${formatK(currentHundred)}</code> viewers!\n๐Ÿ”— <a href="${liveLink}">Join Live</a>`);
150
  }
151
  });
152
 
153
  connection.on('member', (data) => {
154
- if (data.isModerator &&!adminsSeen.has(data.uniqueId)) {
155
  adminsSeen.add(data.uniqueId);
156
- sendToTelegram(`๐Ÿ›ก๏ธ <b>Moderator Joined @${user}:</b>\n๐Ÿ‘ค <code>@${data.uniqueId}</code>`);
157
  }
158
- if (data.userLevel >= 30) sendToTelegram(`๐Ÿ‘‘ <b>VIP Entry (Lvl ${data.userLevel})</b>\n๐Ÿ‘ค Live @${user}: <code>@${data.uniqueId}</code>`);
 
159
  });
160
 
161
  connection.on('gift', (data) => {
162
- if (data.giftType === 1 &&!data.repeatEnd) return;
163
  let giftCost = data.diamondCount * data.repeatCount;
164
  if (!giftersMap[data.userId]) giftersMap[data.userId] = { name: data.nickname, coins: 0 };
165
  giftersMap[data.userId].coins += giftCost;
@@ -167,27 +152,26 @@ async function startRadar(username) {
167
  });
168
 
169
  connection.on('disconnected', () => {
170
- const diffMs = startTime? (new Date() - startTime) : 0;
171
- const totalMinutes = Math.floor(diffMs / 60000);
172
- const durationStr = startTime? formatDuration(totalMinutes) : "Unknown";
 
173
 
174
  let sortedGifters = Object.values(giftersMap).sort((a, b) => b.coins - a.coins).slice(0, 3);
175
  let sortedCommenters = Object.values(commentersMap).sort((a, b) => b.count - a.count).slice(0, 5);
176
- let endMsg = `๐Ÿ <b>End Summary (@${user})</b>\nโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€\nโฑ๏ธ <b>Duration:</b> ${durationStr} | ๐Ÿ“… <b>Time:</b> ${getBaghdadTime()}\n๐Ÿ“Š ๐Ÿ‘๏ธ ${formatK(maxViewers)} | โค๏ธ ${formatK(totalLikes)} | ๐Ÿ”„ ${totalShares}\nโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€\n๐Ÿ† <b>Top 3 Supporters:</b>\n`;
177
 
178
  sortedGifters.forEach((g, i) => {
179
- endMsg += `${i === 0? '๐Ÿฅ‡' : i === 1? '๐Ÿฅˆ' : '๐Ÿฅ‰'} <code>${g.name}</code> : <b>${formatK(g.coins)}</b>\n`;
180
  });
181
 
182
- endMsg += `\n๐Ÿ’ฌ <b>Top 5 Active Commenters:</b>\n`;
183
  sortedCommenters.forEach((c, i) => {
184
  endMsg += `${i+1}. <code>${c.name}</code> (${c.count})\n`;
185
  });
186
 
187
- if (bestGift.cost > 0) endMsg += `\n๐Ÿ’Ž <b>Best Gift:</b> ${bestGift.name} from <b>${bestGift.sender}</b>`;
188
- sendToTelegram(endMsg, bestGift.icon |
189
-
190
- | null, `https://www.tiktok.com/@${user}/live`);
191
 
192
  fastCommentCounter = {};
193
  alertedComments = new Set();
 
3
  const dns = require('dns');
4
  const http = require('http');
5
 
6
+ // --- ุฅุนุฏุงุฏุงุช ุงู„ู†ุธุงู… ---
7
  const TELEGRAM_TOKEN = process.env.TELEGRAM_TOKEN;
8
  const TELEGRAM_CHAT_ID = process.env.TELEGRAM_CHAT_ID;
9
  const SESSION_ID = process.env.SESSION_ID;
10
+ const FIXED_COUNTRY = "ุงู„ุนุฑุงู‚ ๐Ÿ‡ฎ๐Ÿ‡ถ";
11
+ const ACCOUNTS_TO_WATCH = process.env.ACCOUNTS_LIST ? process.env.ACCOUNTS_LIST.split(',') : [];
 
 
12
 
13
  dns.setServers(['8.8.8.8']);
14
 
15
+ // --- ุฏูˆุงู„ ุงู„ุชู†ุณูŠู‚ ูˆุงู„ูˆู‚ุช ---
16
  function formatK(num) {
17
  if (num >= 1000000) return (num / 1000000).toFixed(1) + 'M';
18
  if (num >= 1000) return (num / 1000).toFixed(1) + 'K';
 
20
  }
21
 
22
  function getBaghdadTime() {
23
+ return new Intl.DateTimeFormat('ar-IQ', { timeZone: 'Asia/Baghdad', dateStyle: 'medium', timeStyle: 'medium', hour12: true }).format(new Date());
24
  }
25
 
26
+ // ุฏุงู„ุฉ ุชุญูˆูŠู„ ุงู„ุฏู‚ุงุฆู‚ ุฅู„ู‰ ุณุงุนุงุช ูˆุฏู‚ุงุฆู‚
27
  function formatDuration(totalMinutes) {
28
+ if (totalMinutes < 60) return `${totalMinutes} ุฏู‚ูŠู‚ุฉ`;
29
  const hours = Math.floor(totalMinutes / 60);
30
  const minutes = totalMinutes % 60;
31
+ return minutes > 0 ? `${hours} ุณุงุนุฉ ูˆ ${minutes} ุฏู‚ูŠู‚ุฉ` : `${hours} ุณุงุนุฉ`;
32
  }
33
 
34
  async function sendToTelegram(text, photoUrl = null, targetLink = null) {
35
  try {
36
  const addrs = await new Promise(r => dns.resolve4('api.telegram.org', (e, a) => r(a)));
37
+ const baseUrl = `https://${addrs[0]}/bot${TELEGRAM_TOKEN}`;
38
+ let formattedText = targetLink ? `<a href="${targetLink}">โ€โ€โ€Ž โ€Ž</a>` + text : text;
39
  const payload = { chat_id: TELEGRAM_CHAT_ID, parse_mode: 'HTML', disable_web_page_preview: false };
40
 
41
  if (photoUrl) {
 
47
  await axios.post(`${baseUrl}/sendMessage`, payload, { headers: { 'Host': 'api.telegram.org' } });
48
  }
49
  } catch (e) {
50
+ console.log("โš ๏ธ ุฎุทุฃ ุชู„ุฌุฑุงู…");
51
  }
52
  }
53
 
54
  async function startRadar(username) {
55
  let user = username.trim();
56
+ const primaryOptions = { processInitialData: true, enableWebsocketUpgrade: true, sessionId: SESSION_ID, clientParams: { "app_language": "ar-IQ", "device_platform": "web", "tt_target_idc": "useast1a" } };
57
+ const fallbackOptions = { processInitialData: true, enableWebsocketUpgrade: true, sessionId: SESSION_ID, clientParams: { "app_language": "ar-IQ", "device_platform": "web" } };
58
 
59
  let connection = new WebcastPushConnection(user, primaryOptions);
60
  let highestHundred = 0, maxViewers = 0, totalLikes = 0, totalShares = 0;
61
  let giftersMap = {}, commentersMap = {}, adminsSeen = new Set();
62
+ let bestGift = { name: "ู„ุง ูŠูˆุฌุฏ", cost: 0, sender: "", icon: "" };
63
  let startTime = null;
64
  let fastCommentCounter = {};
65
  let alertedComments = new Set();
 
68
  const state = await connection.connect();
69
  handleConnectionSuccess(state);
70
  } catch (err) {
71
+ console.log(`โš ๏ธ ูุดู„ ุงู„ุงุชุตุงู„ ุงู„ุฃุณุงุณูŠ ู„ู€ ${user}ุŒ ู…ุญุงูˆู„ุฉ ุงู„ุงุชุตุงู„ ุงู„ุงุญุชูŠุงุทูŠ...`);
72
  connection = new WebcastPushConnection(user, fallbackOptions);
73
  try {
74
  const state = await connection.connect();
75
  handleConnectionSuccess(state);
76
  } catch (fallbackErr) {
77
+ console.log(`โŒ ูุดู„ ุงู„ุงุชุตุงู„ ุงู„ุงุญุชูŠุงุทูŠ ุฃูŠุถุงู‹ ู„ู€ ${user}`);
78
  setTimeout(() => startRadar(user), 60000);
79
  return;
80
  }
 
82
 
83
  function handleConnectionSuccess(state) {
84
  startTime = new Date();
85
+ let statusEmoji = state.roomInfo.live_room_mode === 4 ? "๐ŸŽค" : "๐Ÿ”ด";
86
+ let statusText = state.roomInfo.live_room_mode === 4 ? "ุชู†ุจูŠู‡: ุตุงุนุฏ ุฌูŠุณุช ุงู„ุขู†!" : "ุงู†ุทู„ุงู‚ ุงู„ุจุซ ุงู„ู…ุจุงุดุฑ";
87
  let liveLink = `https://www.tiktok.com/@${user}/live`;
88
  if (state.roomInfo.live_room_mode === 4 && state.roomInfo.owner) {
89
  liveLink = `https://www.tiktok.com/@${state.roomInfo.owner.uniqueId}/live`;
90
  }
91
+ let msg = `${statusEmoji} <b>${statusText}</b>\n` + `โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€\n` + `๐Ÿ‘ค <b>ุงู„ุญุณุงุจ:</b> <code>${user}</code>\n` + `๐ŸŒ <b>ุงู„ุฏูˆู„ุฉ:</b> ${FIXED_COUNTRY}\n` + `๐Ÿ“… <b>ุงู„ูˆู‚ุช:</b> <code>${getBaghdadTime()}</code>\n` + `โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€\n` + `๐Ÿ”— <b>ุฑุงุจุท ุงู„ุจุซ:</b> <a href="${liveLink}">${liveLink}</a>`;
 
 
 
 
 
 
92
  sendToTelegram(msg);
93
  }
94
 
95
+ connection.on('like', (data) => { totalLikes = data.totalLikeCount; });
 
96
  connection.on('social', (data) => { if (data.displayType && data.displayType.includes('share')) totalShares++; });
97
 
 
98
  const handleBox = (data, type) => {
99
+ let coins = data.coins || data.diamonds || data.amount || "ุบูŠุฑ ู…ุญุฏุฏ";
100
+ let sender = data.nickname || (data.user && data.user.nickname) || 'ู…ุฌู‡ูˆู„';
101
+ sendToTelegram(`๐Ÿ’ฐ <b>ุชู†ุจูŠู‡ ${type}!</b>\n๐Ÿ‘ค ููŠ ุจุซ: @${user}\n๐ŸŽ ู…ู†: <b>${sender}</b>\n๐Ÿ’Ž ุงู„ู‚ูŠู…ุฉ: <b>${coins} ุนู…ู„ุฉ</b>`);
 
 
 
 
 
 
 
102
  };
103
 
104
+ connection.on('treasureBox', (data) => handleBox(data, "ุญู‚ูŠุจุฉ ุนู…ู„ุงุช"));
105
+ connection.on('luckyBox', (data) => handleBox(data, "ุตู†ุฏูˆู‚ ุญุธ"));
106
+ connection.on('chest', (data) => handleBox(data, "ุญู‚ูŠุจุฉ (ุชูุงุนู„)"));
107
+ connection.on('envelope', (data) => handleBox(data, "ู…ุบู„ู ุนู…ู„ุงุช"));
108
 
109
  connection.on('chat', (data) => {
110
  let text = data.comment.trim();
 
112
  if (!commentersMap[data.userId]) commentersMap[data.userId] = { name: data.nickname, count: 0 };
113
  commentersMap[data.userId].count++;
114
  if (text.length > 1) {
115
+ if (!fastCommentCounter[text]) fastCommentCounter[text] = [];
116
  fastCommentCounter[text].push(now);
117
  fastCommentCounter[text] = fastCommentCounter[text].filter(ts => now - ts < 60000);
118
+ if (fastCommentCounter[text].length >= 100 && !alertedComments.has(text)) {
119
  alertedComments.add(text);
120
+ sendToTelegram(`โš ๏ธ <b>ุณุจุงู… ุณุฑูŠุน @${user}!</b>\n๐Ÿ’ฌ "<code>${text}</code>"\n๐Ÿ”ฅ ุชูƒุฑุฑ 100 ู…ุฑุฉ ููŠ ุฏู‚ูŠู‚ุฉ!`);
121
  setTimeout(() => alertedComments.delete(text), 300000);
122
  }
123
  }
 
130
  if (currentHundred >= 100 && currentHundred > highestHundred) {
131
  highestHundred = currentHundred;
132
  let liveLink = `https://www.tiktok.com/@${user}/live`;
133
+ sendToTelegram(`๐Ÿš€ <b>ุฅู†ุฌุงุฒ @${user}:</b> ูˆุตู„ ุงู„ุขู† <code>${formatK(currentHundred)}</code> ู…ุดุงู‡ุฏ!\n๐Ÿ”— <a href="${liveLink}">ุฏุฎูˆู„ ุงู„ุจุซ</a>`);
134
  }
135
  });
136
 
137
  connection.on('member', (data) => {
138
+ if (data.isModerator && !adminsSeen.has(data.uniqueId)) {
139
  adminsSeen.add(data.uniqueId);
140
+ sendToTelegram(`๐Ÿ›ก๏ธ <b>ู…ุดุฑู ุฏุฎู„ ุจุซ @${user}:</b>\n๐Ÿ‘ค <code>@${data.uniqueId}</code>`);
141
  }
142
+ // ุงู„ุชุนุฏูŠู„: ุชุฑุญูŠุจ VIP ู…ู† ู„ูู„ 30 ูˆููˆู‚
143
+ if (data.userLevel >= 30) sendToTelegram(`๐Ÿ‘‘ <b>ุฏุฎูˆู„ VIP (Lvl ${data.userLevel})</b>\n๐Ÿ‘ค ุจุซ @${user}: <code>@${data.uniqueId}</code>`);
144
  });
145
 
146
  connection.on('gift', (data) => {
147
+ if (data.giftType === 1 && !data.repeatEnd) return;
148
  let giftCost = data.diamondCount * data.repeatCount;
149
  if (!giftersMap[data.userId]) giftersMap[data.userId] = { name: data.nickname, coins: 0 };
150
  giftersMap[data.userId].coins += giftCost;
 
152
  });
153
 
154
  connection.on('disconnected', () => {
155
+ // ุงู„ุชุนุฏูŠู„: ุญุณุงุจ ุงู„ู…ุฏู‡ ูˆุชุญูˆูŠู„ู‡ุง ู„ุณุงุนุงุช ุฅุฐุง ุชุฌุงูˆุฒุช 60 ุฏู‚ูŠู‚ุฉ
156
+ const diffMs = new Date() - startTime;
157
+ const totalMinutes = startTime ? Math.floor(diffMs / 60000) : 0;
158
+ const durationStr = startTime ? formatDuration(totalMinutes) : "ุบูŠุฑ ู…ุญุฏุฏ";
159
 
160
  let sortedGifters = Object.values(giftersMap).sort((a, b) => b.coins - a.coins).slice(0, 3);
161
  let sortedCommenters = Object.values(commentersMap).sort((a, b) => b.count - a.count).slice(0, 5);
162
+ let endMsg = `๐Ÿ <b>ู…ู„ุฎุต ุงู„ู†ู‡ุงูŠุฉ (@${user})</b>\nโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€\nโฑ๏ธ <b>ุงู„ู…ุฏุฉ:</b> ${durationStr} | ๐Ÿ“… <b>ุงู„ูˆู‚ุช:</b> ${getBaghdadTime()}\n๐Ÿ“Š ๐Ÿ‘๏ธ ${formatK(maxViewers)} | โค๏ธ ${formatK(totalLikes)} | ๐Ÿ”„ ${totalShares}\nโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€\n๐Ÿ† <b>ุฃูุถู„ 3 ุฏุงุนู…ูŠู†:</b>\n`;
163
 
164
  sortedGifters.forEach((g, i) => {
165
+ endMsg += `${i === 0 ? '๐Ÿฅ‡' : i === 1 ? '๐Ÿฅˆ' : '๐Ÿฅ‰'} <code>${g.name}</code> : <b>${formatK(g.coins)}</b>\n`;
166
  });
167
 
168
+ endMsg += `\n๐Ÿ’ฌ <b>ุฃูƒุซุฑ 5 ู…ุนู„ู‚ูŠู† ุชูุงุนู„ุงู‹:</b>\n`;
169
  sortedCommenters.forEach((c, i) => {
170
  endMsg += `${i+1}. <code>${c.name}</code> (${c.count})\n`;
171
  });
172
 
173
+ if (bestGift.cost > 0) endMsg += `\n๐Ÿ’Ž <b>ุฃู‚ูˆู‰ ู‡ุฏูŠุฉ:</b> ${bestGift.name} ู…ู† <b>${bestGift.sender}</b>`;
174
+ sendToTelegram(endMsg, bestGift.icon || null, `https://www.tiktok.com/@${user}/live`);
 
 
175
 
176
  fastCommentCounter = {};
177
  alertedComments = new Set();