1
1
mirror of https://gitlab.com/ceda_ei/Quadnite-Bot synced 2026-05-06 05:40:04 +02:00

Add /info

This commit is contained in:
2019-02-12 23:58:22 +05:30
parent 4481e94624
commit 610fadefcc
2 changed files with 38 additions and 0 deletions

36
commands/info.js Normal file
View File

@@ -0,0 +1,36 @@
module.exports = () => (ctx) => {
let text = "";
const msg = ctx.message;
text += `Message ID: \`${msg.message_id}\`\n`;
text += `Chat ID: \`${msg.chat.id}\`\n`;
text += `User ID: \`${msg.from.id}\`\n`;
if (msg.reply_to_message) {
const reply = msg.reply_to_message;
text += "\n*Reply to*\n";
text += `Message ID: \`${reply.message_id}\`\n`;
text += `Chat ID: \`${reply.chat.id}\`\n`;
text += `User ID: \`${reply.from.id}\`\n`;
if (reply.forward_from || reply.forward_from_chat) {
const forward = reply.forward_from ? reply.forward_from
:reply.forward_from_chat;
text += "\n*Forward from*\n";
if (reply.forward_from)
text += "User ID: ";
else
text += "Channel ID: ";
text += `\`${forward.id}\`\n`;
text += "Message Date: `";
const date = new Date(reply.forward_date);
text += date.toUTCString();
text += "`";
}
}
return text;
};