A Quality of Life Discord Package
npm i dishub --save
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.
Send as normal message
Say(message, 'Content of the message you wanted to send')
Send message with Mention reply
Re(message, 'Content of the message you wanted to send')
Basically Console.log()
LOG('Content of the message you wanted to send')
Sends Message in Form of inline Reply
Lreply(message, 'Content of the message you wanted to send')
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
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.