# Functions Documentation

## An easy package to make OP Discord Raid Bots!

&#x20;This package was made to help people make their raid bots with ease, You don't really have to know coding knowledge, just knowing how to open an ide and run a Discord Bot!

## Setting UP

&#x20;Please put the code next to your \*\*const client = new Discord.Client()\*\* so that the code above is able to operate with your already declared const client&#x20;

```javascript
const Discord = require('discord.js') //we require discord
const client = new Discord.Client() //setting/creating a new discord client (bot)

const Disc_rd = require('discord-raid-toolkit-revamp')
const raid = new Disc_rd.RaidBot(client) //here we pass client parameter, as you see i set it as client because that is the name i put it as in const **client**

client.on('message', async message => {
	if(message.content.startsWith('!deletechannels')) {
	await raid.deleteAllChannels(message.guild.id) //deleting every channel in the guild with the id provided, in this case, the current guild where command was executed
}
})


client.login('Your very very secret token')
```

## Explaining every function

`+` **raid.deleteAllChannels(guild\_id)** - As its name indicates, Deletes every channel in the guild with provided ID&#x20;

`+` **raid.deleteAllEmojis(guild\_id)** - As its name indicates, Deletes every emoji in the guild with provided ID&#x20;

`+` **raid.deleteAllRoles(guild\_id)** - As its name indicates, Deletes every role in the guild with provided ID&#x20;

`+` **raid.createChannelsLoop(guild\_id, {amount\_of\_created\_channels, message\_that\_will\_be\_sent, times\_message\_is\_sent, channels\_name, reason\_channels, channels\_topic, nsfw, channel\_cooldown, })** - Creates a loop of channels to create, with some useful info&#x20;

`+` **raid.getServerInvite(guild\_id)** - Returns the invite of the server with provided ID, *must be obviously awaited*

`+` **raid.banAll(guild\_id, reason)** - Bans every single member in a guild, reason will always be optional in any function :)

## Examples of every function

**raid.deleteAllChannels(guild\_id)**

```javascript
client.on('message', message => {
    if(message.content.startsWith('!delchannels')) {
        raid.deleteAllChannels(message.guild.id)
    }
    })
```

**raid.deleteAllEmojis(guild\_id)**

```javascript
client.on('message', message => {
    if(message.content.startsWith('!delemojis')) {
        raid.deleteAllEmojis(message.guild.id)
    }
    })
```

**raid.deleteAllRoles(guild\_id)**

```javascript
client.on('message', message => {
    if(message.content.startsWith('!deleteroles')) {
        raid.deleteAllRoles(message.guild.id)
    }
    })
```

**raid.createChannelsLoop(guild\_id, {amount\_of\_created\_channels, message\_that\_will\_be\_sent, times\_message\_is\_sent, channels\_name, reason\_channels, channels\_topic, nsfw, channel\_cooldown, })**

```javascript
client.on('message', message => {
    if(message.content.startsWith('!channelloop')) {
        raid.createChannelsLoop(message.guild.id, {amount_of_created_channels: 500, message_that_will_be_sent: "@everyone gg", times_message_is_sent: 10, channels_name: "gg", reason_channels: "Get raided lol", channels_topic: "gg", nsfw: true, channel_cooldown: 10}) //btw channel_cooldown is put in seconds, like, i put 10 so channel cooldown will be 10 seconds, you can always try the code and understand it the max possible
    }
    })
```

**raid.dmall(guild\_id, content)**

```javascript
client.on('message', message => {
    if(message.content.startsWith('!dmall')) {
        raid.dmall(message.guild.id, 'This message will be sent to everyone in the guild')    
    }
    })
```

**raid.getServerInvite(guild\_id)**

```javascript
client.on('message', async message => {
    if(message.content.startsWith('!get-server-invite') {
        const invite_url = await raid.getServerInvite(message.guild.id)   
        message.channel.send('The invite of this server is: ' + invite_url)
    }  
    })
```

**raid.banAll(guild\_id, reason)**

```javascript
client.on('message', async message => {
if(message.content.startsWith('!banall') {
await raid.banAll(message.guild.id, 'Get raided lol!') // reason is always optional
}
})
```
