Octanite-Bot/commands/feedback.js

27 lines
696 B
JavaScript
Raw Normal View History

2024-04-16 15:45:54 +02:00
module.exports = (bot, feedback_id) => (ctx) => {
2019-02-12 08:40:01 +01:00
const message = ctx.message.text.replace(/^[^ ]+/, "");
if (message) {
2024-04-16 15:45:54 +02:00
const from = ctx.message.from;
let contactable = "The developer might contact you regarding your feedback.";
if (from.username) {
bot.telegram.sendMessage(feedback_id, `Feedback from: @${from.username}`);
} else {
contactable = "The developer might not be able to contact you due to lack of your username.";
}
2019-02-12 08:40:01 +01:00
ctx.forwardMessage(feedback_id);
2024-04-16 15:45:54 +02:00
return `Thanks for the feedback! ${contactable}`;
2019-02-12 08:40:01 +01:00
} else {
2024-04-16 15:45:54 +02:00
return "To send feedback type in /feedback followed by the feedback. Note that developers may contact you regarding the feedback.";
2019-02-12 08:40:01 +01:00
}
};