Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bes-js/discord-invite
a powerfull discord inviter tracker
https://github.com/bes-js/discord-invite
discord discord-bot discord-bots discord-invite discord-invite-bot discord-invite-manager discord-js discord-v12 discord-v13 discord-v13-bot discord-v14 discord-v14-bot
Last synced: about 2 months ago
JSON representation
a powerfull discord inviter tracker
- Host: GitHub
- URL: https://github.com/bes-js/discord-invite
- Owner: Bes-js
- License: gpl-3.0
- Created: 2023-05-13T16:37:11.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-31T06:46:09.000Z (11 months ago)
- Last Synced: 2024-11-12T15:04:01.215Z (about 2 months ago)
- Topics: discord, discord-bot, discord-bots, discord-invite, discord-invite-bot, discord-invite-manager, discord-js, discord-v12, discord-v13, discord-v13-bot, discord-v14, discord-v14-bot
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/discord-invite
- Size: 93.8 KB
- Stars: 9
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# [discord-invite](https://discord.gg/luppux)
> **Track the invites in your servers to know who invited who and with which invite!**
#
### ❔ [Support](https://discord.gg/luppux)
### 📂 [NPM](https://npmjs.com/discord-invite)
### 📝 [Github](https://github.com/Bes-js/discord-invite)#
# Installation```bash
npm i discord-invite
```
#
# Quick Example
**Example For CommonJS**
```js
/* Importing The Package */
const InviteManager = require('discord-invite');
const invClient = new InviteManager(client); // client = Discord.Client();```
#
**Events**
```js
/* Guild Member Join Event */
client.on("memberJoin",async(member,inviter,invite) => { });/* Guild Member Leave Event */
client.on("memberLeave",async(member,inviter,invite) => { });
```
#
**Functions**
```js
const InviteManager = require('discord-invite');
const { Client } = require("discord.js");
const invClient = new InviteManager(client);invClient.inviteAdd(guildId, user); /* */
invClient.inviteRemove(guildId, user); /* */
invClient.getMemberInvites(guildId, user); /* */
invClient.getGuildInvites(guildId, limit); /* - limit = min 1 / max 50 / default 10 */
```
#
**Example Usage;**
```js
const InviteManager = require('discord-invite');
const { Client } = require("discord.js");
const invClient = new InviteManager(client); // client = Discord.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);
console.log(`${member.user.tag} Joined the server! inviter ${inviter.username}`);
};
});/* Leave Event */
client.on("memberLeave",async(member,inviter,invite) => {
if(!inviter) {
console.log(`${member.user.tag} Lefted the server, but I couldn't find out who was invited.`);
} else if(member.id == inviter.id) {
console.log(`${member.user.tag} Lefted the server by his own invitation!`);
} else if(member.guild.vanityURLCode == inviter) {
console.log(`${member.user.tag} Lefted Server Using Vanity URL!`);
} else {
invClient.inviteRemove(member.guild.id, inviter);
console.log(`${member.user.tag} Lefted the server! inviter ${inviter.tag}`);
};
});client.login("your secret bot token 👻")
```
**[discord-invite](https://discord.gg/luppux) Also Supports TypeScript And EsModule 🥳!**#
# Credits
**Made by [FiveSoBes](https://github.com/Bes-js), [Relivent](https://github.com/Relivent) And [Luppux Development](https://github.com/Luppux)**[![Discord Banner](https://api.weblutions.com/discord/invite/luppux/)](https://discord.gg/luppux)