npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@nesanya/ntr-discord

v1.1.2

Published

Easier work with discord API

Downloads

31

Readme

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