npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@queenanya/invite

v7.0.1

Published

Invite Code For Add Command

Downloads

1,050

Readme

QueenAnya Invite Module

npm GitHub

A utility to Send Group Invite To User's

Installation

npm install @queenanya/invite

OR

yarn add @queenanya/invite

Usage

const { SendGroupInviteMessageToUser } = require('@queenanya/invite');

       const users = '[email protected]'; // user number with @s.whatsapp.net
        const caption = [];
       const metadata = await client.groupMetadata("chat [email protected]");
            const onwa = await client.onWhatsApp(users.split('@')[0]);
            if (onwa.length < 1) {
                caption.push(`❌ Can't find *@${users.split('@')[0]}* on WhatsApp`);
            } else {
            const action = await client.groupParticipantsUpdate(pika.chat, [users], 'add');
            const status = {
                200: `✅ Added *@${users.split('@')[0]}*`,
                408: `❌ *@${users.split('@')[0]}* previously left the chat, couldn't add`,
               403: `_Couldn\'t add. Invite sent! to *@${users.split('@')[0]}*_`,
                409: `⭕ *@${users.split('@')[0]}* already a member`,
                401: `❌ *@${users.split('@')[0]}* has banned my number`
            }
            if (status[action[0].status]) {
                caption.push(status[action[0].status]);
            } else  if (action[0].status == 403) {
			m.reply("inviting");
			console.log(action[0].jid);
			await delay(3000);
		 return await this.SendGroupInviteMessageToUser(action[0].jid, client, m);
		 await delay(2000);
		 m.reply("Invited");
		}
		}

Example Anva V2 WA Bot Usage


const { SendGroupInviteMessageToUser } = require('@queenanya/invite');
const Config = require('../../config');
const { anya, getBuffer, fancy13, Group, announce } = require('../lib');

//༺─────────────────────────────────────༻

anya({
        name: "add",
        react: "👤",
        need: "user",
        category: "admins",
        desc: "Add users to the group",
        rule: 3,
        cooldown: 8,
        filename: __filename
    },
    async (anyaV2, pika, { args, prefix, command }) => {
        if (!pika.quoted && args.length < 1) return pika.reply(`Eg: ${prefix + command} @user1, @user2, @user3 etc...\n\n*Tag one or more users with "," between them to add!*`);
        const text = args.join(" ");
        const users = pika.quoted ? [pika.quoted.sender] : text.replace(/[^0-9,]/g, '') + '@s.whatsapp.net';
        let usrs = text.replace(/[^0-9]/g, '') + '@s.whatsapp.net';
        const { key } = await pika.keyMsg(Config.message.wait);
        const caption = [];
        const metadata = await anyaV2.groupMetadata(pika.chat);
        for (const i of users) {
            const onwa = await anyaV2.onWhatsApp(users.split('@')[0]);
            if (onwa.length < 1) {
                caption.push(`❌ Can't find *@${users.split('@')[0]}* on WhatsApp`);
            } else {
            const action = await anyaV2.groupParticipantsUpdate(pika.chat, [users], 'add');
            const status = {
                200: `✅ Added *@${users.split('@')[0]}*`,
                408: `❌ *@${users.split('@')[0]}* previously left the chat, couldn't add`,
               403: `_Couldn\'t add. Invite sent! to *@${users.split('@')[0]}*_`,
                409: `⭕ *@${users.split('@')[0]}* already a member`,
                401: `❌ *@${users.split('@')[0]}* has banned my number`
            }
           if (status[action[0].status]) {
                caption.push(status[action[0].status]);
            } else  if (action[0].status == 403) {
			pika.reply("inviting");
			console.log(action[0].jid);
			await delay(3000);
		 return await this.SendGroupInviteMessageToUser(action[0].jid, anyaV2, pika.chat);
		 await delay(2000);
		 pika.reply("Invited");
		}
        }
    }
     pika.edit(caption.join('\n\n'), key, { mentions: users });
    }
)

Example For Maira / Case Based Bot

const { SendGroupInviteMessageToUser } = require('@queenanya/invite');

case 'add':
                if (!m.isGroup) return reply(mess.group)
                if (!isAdmins && !isGroupOwner && !isCreator) return reply(mess.admin)
                if (!isBotAdmins) return reply(mess.botAdmin)
                let blockwwww = m.quoted ? m.quoted.sender : text.replace(/[^0-9]/g, '') + '@s.whatsapp.net'
                const caption = []
            const onwa = await Maria.onWhatsApp(blockwwww.split('@')[0]);
            if (onwa.length < 1) {
                caption.push(`❌ Can't find *@${blockwwww.split('@')[0]}* on WhatsApp`);
            } else {
                const result = await Maria.groupParticipantsUpdate(m.chat, [blockwwww], 'add')
                const status = {
                200: `✅ Added *@${blockwwww.split('@')[0]}*`,
                408: `❌ *@${blockwwww.split('@')[0]}* previously left the chat, couldn't add`,
               403: `_Couldn\'t add. Invite sent! to *@${blockwwww.split('@')[0]}*_`,
                409: `⭕ *@${blockwwww.split('@')[0]}* already a member`,
                401: `❌ *@${blockwwww.split('@')[0]}* has banned my number`
            }
            
            if (status[result[0].status]) {
                caption.push(status[result[0].status]);
            } else if (result[0].status == 403) {
			m.reply("inviting");
			console.log(action[0].jid);
			await delay(3000);
		 return await SendGroupInviteMessageToUser(action[0].jid, Maria, m.chat);
		 await delay(2000);
		 m.reply("Invited");
		}
		}
                break
                
                

A utility to Update Full Profile of User's

Installation

npm install @queenanya/invite

OR

yarn add @queenanya/invite

Usage

const { updateProfilePicture } = require('@queenanya/invite');

       const quoted = m.quoted ? m.quoted : m;
            const mime = quoted.msg ? quoted.msg : quoted.mimetype ? quoted.mimetype : quoted.mediaType || '';
            if (/image/.test(mime)) {
                const media = await quoted.download();
                await updateProfilePicture(client, client.user.id, media);

Example Anva V2 WA Bot Usage


const { updateProfilePicture } = require('@queenanya/invite');
const Config = require('../../config');
const { anya, getBuffer, fancy13, Group, announce } = require('../lib');

//༺─────────────────────────────────────༻

anya({
        name: "fullpp",
        alias: ['fullprofile', 'fullprofilepicture', 'fpp'],
        react: "🧿",
        need: "image",
        category: "owner",
        desc: "Set bot full profile picture",
        rule: 1,
        filename: __filename
     },
     async (anyaV2, pika, { prefix, command }) => {
            const quoted = pika.quoted ? pika.quoted : pika;
            const mime = quoted.msg ? quoted.msg : quoted.mimetype ? quoted.mimetype : quoted.mediaType || '';
            if (/image/.test(mime)) {
                const { key } = await pika.keyMsg(Config.message.wait);
                const media = await quoted.download();
                const botnumber = await anyaV2.decodeJid(anyaV2.user.id);
                await updateProfilePicture(anyaV2, anyaV2.user.id, media);
                pika.edit(Config.message.success, key);
            } else pika.reply(`Tag or reply an image with caption *${prefix + command}*`);
     }
)

License

This project is licensed under the GNU General Public License v3.0.


Feel free to contribute, open issues, and submit pull requests. If you find any bugs or have suggestions, please create an issue.

For more information and updates, check out the GitHub repository and npm package.