discord-antialts
v1.1.0
Published
Easy to use discord.js anti alt package for your bot! Uses discord.js v13.
Downloads
17
Maintainers
Keywords
Readme
Discord Anti Alts
Easy to use discord.js anti alts package for your bot! Uses discord.js v13.
Getting Started
Installation
npm install discord-antialts
Usage
const { AntiAltClient } = require("discord-antialts");
const Discord = require("discord.js");
const client = new Discord.Client({
intents: 32767,
});
client.on("ready", () => {
console.log(`Logged in as ${client.user.tag}!`);
});
const c = new AntiAltClient({
debug: false,
altDays: 7, // optional,default 7
});
client.on("guildMemberAdd", (member) => {
c.init(member, {
action: "kick", // optional default kick
whitelistUsers: ["role1", "role2"], // optional default none
});
});
/**
* @param {Discord.GuildMember} member - Guild member
* @param {Object} date - Object of user createdAt, joinedAt, and how many days old the user is
* @param {String} action - Action to take
*/
c.on("altAction", (member, date, action) => {
const embed = new MessageEmbed()
.setTitle("Alt Found!")
.setColor("RANDOM")
.setFooter("Discord AntiAlts")
.setTimestamp().setDescription(`
**__Alt Name__**: ${member.user} (${member.user.username})
**__ID__**: ${member.user.id}
**__Account Created__**: ${date.createdAt} days ago
**__Account Creation Date__**: ${date.createdAtDate}
**__Join Position__**: ${member.guild.memberCount}
**__Join Date__**: ${date.joinAt}
`);
client.channels.cache.get("your id").send({ embeds: [embeds] });
});
client.login("your super secret token");
Got some errors/bugs?
Join here for help.