Compare commits

...

2 Commits

Author SHA1 Message Date
Ceda EI 2ca39208d9 Merge branch 'main' of https://gitlab.com/ceda_ei/Quadnite-Bot 2024-10-13 20:28:07 +05:30
Ceda EI 7cf9689420 Copy message text for feedback instead of forwarding
Telegram's pseudo-DRM prevents bots from forwarding messages in chats
with "Restrict Saving Content"
2024-10-13 20:26:07 +05:30
1 changed files with 4 additions and 2 deletions

View File

@ -5,16 +5,18 @@ module.exports = (bot, feedback_id) => (ctx) => {
const from = ctx.message.from; const from = ctx.message.from;
let contactable = "The developer might contact you regarding your feedback."; let contactable = "The developer might contact you regarding your feedback.";
let message;
if (from.username) { if (from.username) {
bot.telegram.sendMessage(feedback_id, `Feedback from: @${from.username}`); message = `Feedback from: @${from.username}`;
} else { } else {
contactable = "The developer might not be able to contact you due to lack of your username."; 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}`; return `Thanks for the feedback! ${contactable}`;
} else { } else {