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

discord-invite

v4.0.8

Published

a powerfull discord inviter tracker

Downloads

6,556

Readme

discord-invite

Track the invites in your servers to know who invited who and with which invite!

Support

📂 NPM

📝 Github

Click here for an example of a ready-made bot made using TypeScript.

Installation

npm i discord-invite

Quick Example

Example For CommonJS

/* Importing The Package */
const InviteManager = require('discord-invite');
const invClient = new InviteManager(client); // client = Discord.Client();

Events

/* Guild Member Join Event */
client.on("memberJoin",async(member,inviter,invite) => { });

/* Guild Member Leave Event */
client.on("memberLeave",async(member,inviter,invite) => { });

Functions

const InviteManager = require('discord-invite');
const { Client } = require("discord.js");
const invClient = new InviteManager(client);

invClient.inviteAdd(guildId, user, count); /* <null> */
invClient.inviteRemove(guildId, user, count); /* <null> */
invClient.getMemberInvites(guildId, user); /* <number> */
invClient.getGuildInvites(guildId, limit); /* <Array> */

Example Usage;

const InviteManager = require('discord-invite');
const { Client } = require("discord.js");
const client = new Client();
const invClient = new InviteManager(client);


/* Join Event */

client.on("memberJoin", async function(member, inviter, invite) {
if(!inviter) {
  console.log(`${member.user.username} joined the server, but I couldn't find out who was invited.`);
} else if(member.id == inviter.id) {
  console.log(`${member.user.username} Joined the server by his own invitation!`);
}else if(member.guild.vanityURLCode == inviter) {
  console.log(`${member.user.username} Joined Server Using Vanity URL!`);
} else {
  invClient.inviteAdd(member.guild.id, inviter,1);
  console.log(`${member.user.username} Joined the server! inviter ${inviter.username}`);
};
});

/* Leave Event */

client.on("memberLeave",async(member,inviter,invite) => {
if(!inviter) {
 console.log(`${member.user.username} Lefted the server, but I couldn't find out who was invited.`);
} else if(member.id == inviter.id) {
 console.log(`${member.user.username} Lefted the server by his own invitation!`);
} else if(member.guild.vanityURLCode == inviter) {
 console.log(`${member.user.username} Lefted Server Using Vanity URL!`);
} else {
 invClient.inviteRemove(member.guild.id, inviter,1);
 console.log(`${member.user.username} Lefted the server! inviter ${inviter.username}`);
};
});


client.login("your secret bot token 👻")

discord-invite Also Supports TypeScript And EsModule 🥳!

Credits

Made by FiveSoBes And Luppux Development

Contact & Support & Donate

Discord Banner