New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@nesanya/ntr-discord

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nesanya/ntr-discord - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

30

index.js

@@ -1,2 +0,2 @@

class Msg {
class MsgDS {
constructor(client ,prefix) {

@@ -7,5 +7,8 @@ this.client = client

MsgReply(ImportMessage, ExportMessage) {
MsgReply(ImportMessage, ExportMessage, botCheker) {
this.client.on("message", msg => {
if(msg.content === this.prefix + ImportMessage) {
if(botCheker){
if(msg.author.bot) return
}
msg.reply(ExportMessage)

@@ -15,5 +18,8 @@ }

}
MsgCallback(ImportMessage, callback) {
MsgCallback(ImportMessage, callback, botCheker) {
this.client.on("message", message => {
if(message.content === this.prefix + ImportMessage) {
if(botCheker){
if(message.author.bot) return
}
callback(message)

@@ -37,4 +43,20 @@ }

}
CallbackWelcomer(callback){
this.client.on("guildMemberAdd", member => {
callback(member)
})
}
SimpleWelcomer(textChat, ExportText){
this.client.on("guildMemberAdd", 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(`${member}, ${ExportText}`)
})
}
}
module.exports = { Msg, MainDS }
module.exports = { MsgDS , MainDS }

3

package.json
{
"name": "@nesanya/ntr-discord",
"version": "1.0.4",
"version": "1.0.5",
"description": "Easier work with discord API",

@@ -10,2 +10,3 @@ "main": "index.js",

"dependencies": {
"@discordjs/opus": "^0.1.0",
"discord.js": "^12.0.2"

@@ -12,0 +13,0 @@ },

@@ -8,2 +8,4 @@ # NTR-discord

GITHUB - [Click here](https://github.com/NEsanya/NTR-discord.git)
---

@@ -35,3 +37,68 @@

msg.MsgReply("ping", "pong")
msg.MsgReply("ping", "pong!")
msg.MsgCallback("pong", message => {
message.reply("ping!")
})
```
***
> 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}!`)
})
```
***
> 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 { Msg } = require("@nesanya/ntr-discord")
const msg = new Msg(client, "YOUR PREFIX")
msg.MsgReply("ping (question)", "pong (answer)")
// 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 { Msg } = require("@nesanya/ntr-discord")
const msg = new Msg(client, "YOUR PREFIX")
msg.MsgCallback("pong", message => {
message.reply("ping!")
})
// Returned: ping!
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc