npm package: @nesanya/ntr-discord
Description: Easier work with discord API
Author: NEsanya
Latest version: 1.1.2

# NTR-discord
Easier work with discord API :)

---

NPM - [Click here](https://www.npmjs.com/package/@nesanya/ntr-discord)

GITHUB - [Click here (Always the latest documentation)](https://github.com/NEsanya/NTR-discord.git)

---

> The library was created in order to:

- Increase development speed
- Shorten code
- Increase code readability

---

> install - npm install @nesanya/ntr-discord

---

###### Code example: 
```js
const Discord = require("discord.js")
const client = new Discord.Client()
const { MsgDS, MainDS } = require("@nesanya/ntr-discord")
const main = new MainDS(client, "You'r token here")
const msg = new MsgDS(client, "You'r prefix")

main.start(function(){
    console.log(`Logged in as ${client.user.tag}!`)
})

msg.MsgReply("ping", "pong!", true)

msg.MsgCallback("pong", message => {
    message.reply("ping!")
}, true)
```

***

> MainDS Class

> Method start

Method start calling function client.login ([Explanation here](https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=login)) and calling fucntion client.on("ready") ([Explanation here](https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=e-ready))

###### Code example: 
```js
/** *@example start */
const Discord = require("discord.js")
const client = new Discord.Client()
const { MainDS } = require("@nesanya/ntr-discord")
const main = new MainDS(client, TOKEN_HERE)

main.start(() => {
  console.log(`Logged in as ${client.user.tag}!`)
})
```
> SimpleWelcomer method

Welcomes new users to the server

###### Code example:
```js
/** *@SimpleWelcomer example */
const Discord = require("discord.js")
const client = new Discord.Client()
const { MainDS } = require("@nesanya/ntr-discord")
const main = new MainDS(client, TOKEN_HERE)

main.SimpleWelcomer("YOU'R WELCOME_CHAT", "Hello World Message")
```

> CallbackWelcomer method

Welcomes new user to the server with callback

###### Code example:
```js
/** *@CallbackWelcomer example */
const Discord = require("discord.js")
const client = new Discord.Client()
const { MainDS } = require("@nesanya/ntr-discord")
const main = new MainDS(client, TOKEN_HERE)

main.CallbackWelcomer( member => {
 const channel = member.guild.channels.cache.find(ch => ch.name === textChat)
 if(!channel) {
  throw new Error("NTR-Discord: channel not find (SimpleWeclomer)")
 }
 channel.send(`Hello ${member}`)
})
```

***

> Msg Class

> Method MsgReply


The MsgReply method calls fucntion client.on ("message") ([Explanation here](https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=e-message)) , and it works like question/asnwer

###### Code example: 
```js
/** *@example MsgReply */
const Discord = require("discord.js")
const client = new Discord.Client()
const { MsgDS } = require("@nesanya/ntr-discord")
const msg = new MsgDS(client, "PREFIX")

msg.MsgReply("ping (question)", "pong (answer)", true) // last function param check, is bot? If true => return

// To call, enter the channel "YOUR_PREFIX" + ping into your discord
```

> Method MsgCallback

MsgCallback works like MsgReply, but instead of answering you call your function (function parameters: message ([Explanation here](https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=e-message)))

###### Code example: 
```js
/** *@example MsgCallback */
const Discord = require("discord.js")
const client = new Discord.Client()
const { MsgDS } = require("@nesanya/ntr-discord")
const msg = new MsgDS(client, "YOUR PREFIX")

msg.MsgCallback("pong", message => {
    message.reply("ping!")
}, true) // last function param check, is bot? If true => return

// Returned: ping!
```

---

> Admin class 

> Act method

This method kicked or banned member's on pinged

###### Code example: 
```js
/** *@Act example */
const Discord = require("discord.js")
const client = new Discord.Client()
const { AdminDS } = require("@nesanya/ntr-discord")
const Admin = new AdminDS(client, "YOUR_PREFIX")

Admin.Act("kick" // If you wrote ban, member was been banned
"Command to kick & ban here",
"Permission warning here",
"Isn't guild warning here",
"Kick reason here",
"Bot_Permission Error here",
"Successfully kicked message/embed here")

// !kick @user#0001 => Successfully kicked/banned message/embed here && warning/error
```
```