djs-linereply
v2.3.0
Published
This package allows you to add in-line relies using discord.js very easily.
Downloads
3
Maintainers
Readme
Install
$ npm i djs-linereply
Setup
const discord = require('discord.js');
require('djs-linereply'); //⚠️ IMPORTANT: put this before your discord.Client()
const client = new discord.Client(
{
//OPTIONS
}
);
Example
const discord = require('discord.js');
require('djs-linereply'); //⚠️ IMPORTANT: put this before your discord.Client()
const client = new discord.Client(
{
//OPTIONS
}
);
client.on('ready', () => {
console.log('Bot is online.');
});
client.on('message', async message => {
if (message.content.startsWith('inline-mention')) {
message.lineReply('Hey'); //Inline Reply with mention
} else if (message.content.startsWith('inline-nomention')) {
message.lineReplyNoMention('Hey'); //Inline Reply without mention
};
});
client.login('TOKEN');
Embed
if (message.content.startsWith('inline')) {
let embed = new discord.MessageEmbed()
.setDescription(`Reply to ${message.author.username}`);
message.lineReply(embed); //Line (Inline) Reply with mention
//or
message.lineReplyNoMention(embed); //Line (Inline) Reply without mention
};
if (message.content.startsWith('inline')) {
let m = await message.lineReply('Hi');
let ping = (m.createdTimestamp - message.createdTimestamp);
m.edit('Hello');
};
Command Handler
/**
* No need to define it
* */
module.exports = {
name: 'inline',
run: (client, message, args) => {
message.lineReply('This is reply with @mention');
}
}