Add username in feedback
This commit is contained in:
parent
5ededd535f
commit
bdf52331b1
|
@ -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.";
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ module.exports = (bot, [ questions, kys, insults, commands_list, words, roleplay
|
|||
"Markdown"}));
|
||||
bot.command("weebify", (ctx) => ctx.reply(weebify()(ctx)));
|
||||
bot.command("absurdify", (ctx) => ctx.reply(absurdify()(ctx)));
|
||||
bot.command("feedback", (ctx) => ctx.reply(feedback(feedback_id)(ctx)));
|
||||
bot.command("feedback", (ctx) => ctx.reply(feedback(bot, feedback_id)(ctx)));
|
||||
bot.command("wiki", (ctx) => media_wiki(axios,
|
||||
"https://en.wikipedia.org/w/api.php")(ctx).then(x => ctx.reply(x,
|
||||
{parse_mode: "HTML"})));
|
||||
|
|
Loading…
Reference in New Issue