mirror of
https://gitlab.com/ceda_ei/Quadnite-Bot
synced 2026-05-06 05:40:04 +02:00
Add username in feedback
This commit is contained in:
@@ -1,14 +1,25 @@
|
||||
module.exports = (feedback_id) => (ctx) => {
|
||||
module.exports = (bot, feedback_id) => (ctx) => {
|
||||
|
||||
const message = ctx.message.text.replace(/^[^ ]+/, "");
|
||||
if (message) {
|
||||
|
||||
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.";
|
||||
|
||||
}
|
||||
ctx.forwardMessage(feedback_id);
|
||||
return "Thanks for the feedback";
|
||||
return `Thanks for the feedback! ${contactable}`;
|
||||
|
||||
} else {
|
||||
|
||||
return "To send feedback type in /feedback followed by the feedback";
|
||||
return "To send feedback type in /feedback followed by the feedback. Note that developers may contact you regarding the feedback.";
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user