1.1.1 • Published 9 months ago

@sereneapi/discord-protect v1.1.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
9 months ago

Discord-Protect

Use Exemple:

const Discord = require("discord.js")
const client = new Discord.Client({intents: 3276799})
const Protect = require("@sereneapi/discord-protect")

client.on("messageCreate", async message => {

    if(message.author.bot) return;
    await Protect.Antibadword(client, ["exemple", "exemple2"], message).then(async result => {

        if(result) {

            message.delete()

        }

    })

    await Protect.Antilink(client, message).then(async result => {

        if(result) {

            message.delete()

        }

    })
    await Protect.Antispam(client, message, 5, 3).then(async result => { // 5 is the cooldown in seconds. 3 is the limit of message.

        if(result) {

            if(message.deletable) {

                message.delete()

            }

        }


    }) 

})

client.on("guildMemberAdd", async (member) => {

    await Protect.Antialt(member, 5).then(async result => { // 5 equal minimal age in month

        if(result) {

            member.kick()

        }

    })
    await Antibot(member).then(async result => {

        if(result) {

            member.kick()

        }

    })

})

client.login("YOUR_TOKEN_HERE")```