From 6cc666a2844305ae639c9fde0fcce9280677a8ac Mon Sep 17 00:00:00 2001 From: White Shadow Ofc Date: Tue, 23 Apr 2024 08:47:37 +0530 Subject: [PATCH] =?UTF-8?q?[=20Jessi-md=20V-=205.0.0=E2=98=87=20]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/group-get-join-list.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 plugins/group-get-join-list.js diff --git a/plugins/group-get-join-list.js b/plugins/group-get-join-list.js new file mode 100644 index 00000000..a1904946 --- /dev/null +++ b/plugins/group-get-join-list.js @@ -0,0 +1,29 @@ +let handler = async (m, { conn, usedPrefix, command }) => { + const response = await conn.groupRequestParticipantsList(m.chat); + if (!response || !response.length) { + conn.reply(m.chat, 'No pending join requests. โœ…', m); + return; + } + + let replyMessage = '๐Ÿ˜‰ Join Request List:\n'; + response.forEach((request, index) => { + const { jid, request_method, request_time } = request; + const formattedTime = new Date(parseInt(request_time) * 1000).toLocaleString(); + + replyMessage += `\n*No.: ${index + 1} Request Details. ๐Ÿ‘‡*`; + replyMessage += `\n๐ŸงŸโ€โ™‚๏ธ *JID:* ${jid}`; + replyMessage += `\n๐Ÿงช *Method:* ${request_method}`; + replyMessage += `\nโฐ *Time:* ${formattedTime}\n`; + }); + + conn.reply(m.chat, replyMessage, m); +}; + +handler.help = ['getjoinreq']; +handler.tags = ['group', 'admins']; +handler.command = /^(getjoinreq)$/i; +handler.admin = true; +handler.group = true; +handler.botAdmin = true; + +export default handler;