From f0a918f77e76834f463e286e485bc890fb65049b Mon Sep 17 00:00:00 2001 From: Ceda EI Date: Fri, 9 Jul 2021 13:22:01 +0530 Subject: [PATCH] Allow roleplay to include a user via reply --- commands/roleplay.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/commands/roleplay.js b/commands/roleplay.js index ad40b97..1c0701c 100644 --- a/commands/roleplay.js +++ b/commands/roleplay.js @@ -14,6 +14,10 @@ module.exports = (forms, gifs) => (ctx) => { const message = ctx.message.text.replace(/^[^ ]+\s*/, "") .match(/^((@\w+(\s+|$))*)(.*)/); const users = message[1].trim().split(" ").filter(i => i.length); + const rtm = ctx.message.reply_to_message; + if (rtm) + users.push(rtm.from.username ? "@" + rtm.from.username + : rtm.from.first_name); const reason = message[4]; let reply = ""; const from = ctx.message.from;