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

Easier work with discord API

  • 1.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by50%
Maintainers
1
Weekly downloads
 
Created
Source

NTR-discord

Easier work with discord API :)


NPM - Click here

GITHUB - Click here (Always the latest documentation)


The library was created in order to:

  • Increase development speed
  • Shorten code
  • Increase code readability

install - npm install @nesanya/ntr-discord


Code example:
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) and calling fucntion client.on("ready") (Explanation here)

Code example:
/** *@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:
/** *@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:
/** *@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) , and it works like question/asnwer

Code example:
/** *@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))

Code example:
/** *@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:
/** *@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

Keywords

FAQs

Package last updated on 18 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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