1.2.5 • Published 3 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!")
Say
is the package's Function for normal message.message
is 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]
=1
Normal,2
Reply with mention,3
lineReply with mention,4
lineReply Without Mentioncontent
= The content of next message or message tht will be send.time
= Time to wait till deletes happen.