Кабинет

Посты канала Flex Coder

сначала новые

#1669Фото
Просмотры46−73%к среднему
Пересылки—
Реакции3
Комментарии—
#1668Фото
Просмотры98−42%к среднему
Пересылки—
Реакции2
Комментарии—
#1662Фото
Просмотры308+82%к среднему
Пересылки—
Реакции4
Комментарии—
#1658Текст

🧑‍💻 Command: /flexreply Code: export const commandName = "__message__"; const esc = (s) =>   String(s ?? "")     .replace(/&/g, "&amp;")     .replace(/</g, "&lt;")     .replace(/>/g, "&gt;"); export default async function flexReply(flex) {   const adminId = Number(process.env.ADMIN_ID);   const msg = flex.request.body.message;   if (!msg || flex.isCallback || flex.isInlineQuery) return;   if (flex.chat.chat_type !== "private") return;   if (flex.user.id !== adminId) {     try {       const fwd = await API.forwardMessage({         chat_id: adminId,         from_chat_id: flex.chat.id,         message_id: flex.message_id,       });       const canReplyDirectly =         fwd?.forward_origin?.sender_user?.id ?? fwd?.forward_from?.id;       if (!canReplyDirectly) {         const name =           fwd?.forward_origin?.sender_user_name ?? fwd?.forward_sender_name;         await API.sendMessage({           chat_id: adminId,           parse_mode: "HTML",           reply_parameters: { message_id: fwd.message_id },           text: `<b>👤 ${esc(name)}</b>\n🆔 ID: <code>${flex.user.id}</code>\n\n<i>Reply to this message to answer the user</i>`,         });       }     } catch (err) {       console.log(`[relay] forward failed: ${err.message}`);     }     return;   }   const replied = msg.reply_to_message;   if (!replied) return;   let targetId =     replied.forward_origin?.sender_user?.id ?? replied.forward_from?.id;   if (!targetId && replied.from?.is_bot) {     const match = (replied.text ?? "").match(/ID:\s*(\d+)/);     if (match) targetId = Number(match[1]);   }   if (!targetId) {     const hidden =       replied.forward_origin?.type === "hidden_user" ||       replied.forward_sender_name;     if (hidden) {       return sendMessage(         "<b>⚠️ This user hides forwarding. Reply to the <b>ID message</b> which is below the forwarded message.</b>",       );     }     return;   }   try {     await API.copyMessage({       chat_id: targetId,       from_chat_id: flex.chat.id,       message_id: flex.message_id,     });   } catch (err) {     console.log(`[relay] copy failed: ${err.message}`);     await sendMessage("<b>❌ Could not deliver the reply to the user.</b>");   } }

Открыть в Telegram
Просмотры221+31%к среднему
Пересылки—
Реакции3
Комментарии—
#1657Текст
Просмотры144−15%к среднему
Пересылки—
Реакции3
Комментарии—
#1656Фото
Просмотры153−10%к среднему
Пересылки—
Реакции3
Комментарии—
#1654Фото
Просмотры257+52%к среднему
Пересылки—
Реакции3
Комментарии—
#1653Фото
Просмотры235+39%к среднему
Пересылки—
Реакции3
Комментарии—
#1651Текст
Просмотры226+34%к среднему
Пересылки—
Реакции3
Комментарии—
#1650Фото
Просмотры222+31%к среднему
Пересылки—
Реакции2
Комментарии—
#1648Фото
Просмотры222+31%к среднему
Пересылки—
Реакции2
Комментарии—