# discord-security

> Punish members who abuse admin functions

Latest version **1.2.7** (published 2022-10-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install discord-security
pnpm add discord-security
yarn add discord-security
bun add discord-security
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.7 |
| Published | 2022-10-27 |
| First published | 2022-10-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 17.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | ! LetsGoz |
| Maintainers | letsgoz |
| Keywords | security, discord, antiraid, antispam, antiflood, discord security, discord.js, discordjs |

## Links

- npm: https://www.npmjs.com/package/discord-security
- npm.io page: https://npm.io/package/discord-security

## Dependencies (2)

- [megadb](https://npm.io/package/megadb.md) ^3.4.0
- [discord.js](https://npm.io/package/discord.js.md) ^13.7.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.2.7 (latest) — 2022-10-27
- 1.2.6 — 2022-10-27
- 1.2.5 — 2022-10-27
- 1.2.4 — 2022-10-27
- 1.2.3 — 2022-10-27
- 1.2.2 — 2022-10-27
- 1.2.0 — 2022-10-27
- 1.1.41 — 2022-10-27
- 1.1.40 — 2022-10-27
- 1.1.39 — 2022-10-27
- 1.1.38 — 2022-10-27
- 1.1.37 — 2022-10-27
- 1.1.36 — 2022-10-27
- 1.1.35 — 2022-10-27
- 1.1.34 — 2022-10-27
- … 44 more at https://npm.io/package/discord-security/versions

## README

## 💖 Features
 - Easy to use
 - Anti-Raid System
 - Configurable
 - Works with all DJS versions

## ✨ How to use
```js
const Discord = require('discord.js'); // Requiring Discord
const intents = new Discord.Intents(); // Intents 
const client = new Discord.Client({ intents: 32767 }); // Bot

const DiscordSecurity = require('discord-security'); // Requiring the module
DiscordSecurity.init({  // Initialize the package
    client: client, // Client (bot)
    interval: 10, // Interval for reset data (in seconds)
    limit: 3, // Max infractions did in the interval (10 seg) to punish
    punishment: 'delete_roles', // Punishment
    whitelist: ['user_id', 'role_id'], // Ignored users
    options: {  // AntiRaid Options
            memberKick: true, // AntiKick System
            memberBan: true, // AntiBan System
            roleUpdate: true, // AntiRoleUpdate System
            roleAdd: true, // AntiRoleAdd System
            roleCreate: true, // AntiRoleCreate System
            roleDelete: true, // AntiRoleDelete System
            channelCreate: true, // AntiChannelCreate System
            channelDelete: true, // AntiChannelDelete System
            guildUpdate: true, // AntiGuildUpdate Sytem
        }
});

client.on('ready', async () => {
    console.log(`Logged in as ${client.user.username}.`)
});

client.login('YOUR TOKEN')

```

## 📌 Remove Anti-Raid Data

```js

const Discord = require('discord.js'); // Requiring Discord
const intents = new Discord.Intents(); // Intents 
const client = new Discord.Client({ intents: 32767 }); // Bot

const DiscordSecurity = require('discord-security'); // Requiring the module
DiscordSecurity.removeData()  // Remove AntiRaid Data

```

---
_Source: https://npm.io/package/discord-security · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
