0.1.1 • Published 4 years ago

discord.js-simplified v0.1.1

Weekly downloads
1
License
MIT
Repository
-
Last release
4 years ago

A add-on for Discord.js that help you to be more productive.

This library works with Stable of Discord.js 11.x And node 8.x & above

(some functions can work with Master)

Documentation

Usage: ping(<client>) Return: <string>

Get the ping of your client

Example:

const Discord = require('Discord.js') 
const { ping } = require('discord.js-simplified') 
const client = new Discord.Client()

client.on('message', message => {
   if(message.content.startsWith('!ping')) {
      message.channel.send(ping(client)) //returns the ping of your client  
   }
}) 

client.login(process.env.TOKEN)

Usage: membersInfo(<guild>) Return: { all: <number>, online: <number>, idle: <number>, dnd: <number>, offline: <number> }

Check guild members sorted by status

Example:

const Discord = require('discord.js')  
const { membersInfo } = require('discord.js-simplified') 
const client = new Discord.Client()

client.on('message', message => {
 let members = membersInfo(message.guild)
    console.log(m.all)
    console.log(m.online)
    console.log(m.idle)
    console.log(m.dnd)
    console.log(m.offline)  
}) 

client.login(process.env.TOKEN)

Usage: ifHaveNitro(<user>, [ifMaster]) Return: <boolean>

The majority of members who own nitro will be detected. Be careful, there is a good chance that this program will be wrong because it remains theoretical, it may be that people who have nitro will not be detected and vice versa

Example:

const Discord = require("discord.js")
const client = new Discord.Client()
const { ifHaveNitro } = require("discord.js-simplified") 

client.on('message', message => {
  if(message.content.startsWith("!checknitro")) {
    let result = ifHaveNitro(message.author)
    
    if(result) {
      return message.channel.send("I think you have nitro")
    } else {
      return message.channel.send("I don't think you have nitro") 
    } 
  } 
}) 

client.login(process.env.TOKEN) 

Usage: miniEmbed(content, color, channel, ifMaster) Return: <promise> (message)

if 'ifMaster' is equal to true this will works with discord.js 12.0-dev

Example:

const { miniEmbed } = require('discord.js-simplified')
const Discord = require('discord.js')
const client = new Discord.Client()

client.on('message', message => {
  miniEmbed('hey bro', '#ffffff', message.channel) 
})

client.login(process.env.TOKEN)
0.1.1

4 years ago

0.1.0

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago