1.0.1 • Published 2 years ago

discord-invitations v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Installation

> npm install discord-invitations

What is the package?

With the discord-invitations package you can get all the invite information related to your Discord server

Properties

It is easy for you to use, you can get all the invitation information such as the member, the invitation link code, the number of invitations, the maximum number of uses for the invitation link and the inviter, and we also update the package regularly

Example of how to use

const { Client, Intents } = require("discord.js");

const client = new Client({
    intents: [
        Intents.FLAGS.GUILDS,
        Intents.FLAGS.GUILD_MESSAGES,
        Intents.FLAGS.GUILD_MEMBERS,
        Intents.FLAGS.GUILD_INVITES
    ],
})

client.login("")

client.on("ready", () => {
    client.user.setPresence({ activities: [{ name: 'discord-invitations' }] })
    console.log('\x1b[32m%s\x1b[0m', `${client.user.tag} is online now!`)
})

const discordInvitations = require("discord-invitations")
let invitationsMonitor = new discordInvitations(client)

invitationsMonitor.on("newMemberJoined", async(member, code, numberOfInvitations, maxUses, inviter) => {
    client.channels.cache.get("966825924647608370").send(`${member} has been invited by ${inviter} who has \`${numberOfInvitations}\` invitations!`)
})