1.2.5 • Published 4 years ago
dishub v1.2.5
What is this?
A Quality of Life Discord Package
Installation
npm i dishub --save
Usage
let Discord = require("discord.js");
let client = new Discord.Client();
let { Say , Re, LOG, Lreply, Edit, Delete } = require('dishub')
client.on("message", message => {
if (message.content === "ping") {
Say(message, "pong!")
}
if (message.content === "ping") {
Re(message, "pong!")
}
if (message.content === "ping") {
LOG("pong!")
}
if (message.content === "ping") {
Lreply(message, "pong!")
}
if(message.content === 'edit')
{
message.channel.send("hi")
.then(x =>
{
Edit(x, "hehehe", 3000)
Edit(x, "lol", 5000)
Edit(x, "xd", 7000)
Edit(x, "bruh", 9000)
})
}
if (message.content === "ping")
{
Delete(message, 1,"pong!", 10000)
}
})
client.login("YOUR TOKEN HERE")Explanations
Say(message, "pong!")Sayis the package's Function for normal message.messageis mesage event where you defined it as message or else. If you defined message event as msg then the code will be like this.
Say(msg, "pong!")"pong!"or content of thing you wanted to send. It Self-Explanatory.
Available Options
Say
Send as normal message

Say(message, 'Content of the message you wanted to send')Re
Send message with Mention reply

Re(message, 'Content of the message you wanted to send')LOG
Basically Console.log()

LOG('Content of the message you wanted to send')Lreply
Sends Message in Form of inline Reply

Lreply(message, 'Content of the message you wanted to send')Edit
Edit function for simplify on editing message using setTimeout

message= The message that will be edited.content= The content of next message or message tht will be replace to.time= Time to wait till next edits.
Edit(message, content, time[ miliseconds ])Delete
Delete function for simplify on deleting a message after sometime
Delete(message, 1, "hi", 2000) // sends "hi" as normal message and delete after 2 sec
Delete(message, Option, Content, time[ miliseconds ])message= The message that will be deleted.Option[1, 2, 3, 4]=1Normal,2Reply with mention,3lineReply with mention,4lineReply Without Mentioncontent= The content of next message or message tht will be send.time= Time to wait till deletes happen.