Allow roleplay to include a user via reply

This commit is contained in:
Ceda EI 2021-07-09 13:22:01 +05:30
parent 463d9c254b
commit f0a918f77e
1 changed files with 4 additions and 0 deletions

View File

@ -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;