From 7cf9689420189d7edb94878eca80a1c39282a2ee Mon Sep 17 00:00:00 2001 From: Ceda EI Date: Sun, 13 Oct 2024 20:26:07 +0530 Subject: [PATCH] Copy message text for feedback instead of forwarding Telegram's pseudo-DRM prevents bots from forwarding messages in chats with "Restrict Saving Content" --- commands/feedback.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/commands/feedback.js b/commands/feedback.js index 2ffba13..1a171c4 100644 --- a/commands/feedback.js +++ b/commands/feedback.js @@ -5,16 +5,18 @@ module.exports = (bot, feedback_id) => (ctx) => { const from = ctx.message.from; let contactable = "The developer might contact you regarding your feedback."; + let message; if (from.username) { - bot.telegram.sendMessage(feedback_id, `Feedback from: @${from.username}`); + message = `Feedback from: @${from.username}`; } else { contactable = "The developer might not be able to contact you due to lack of your username."; + message = `Feedback from User ${from.id}`; } - ctx.forwardMessage(feedback_id); + bot.telegram.sendMessage(feedback_id, `${message} ${ctx.message.text}`).catch(console.log); return `Thanks for the feedback! ${contactable}`; } else {