1.0.2 • Published 4 years ago
discord-replio v1.0.2
Install
$ npm i discord-reply
Setup
const discord = require('discord.js');
require('discord-replio'); //Make sure you put it here
const client = new discord.Client();
Example
const discord = require('discord.js');
require('discord-replio'); //Make sure you put it here
const client = new discord.Client();
client.on('ready', () => {
console.log(client.user.tag)
});
client.on('message', async message => {
if (message.content.startsWith('!reply')) {
message.lineReply('With mention.'); //Line (Inline) reply - mention
message.lineReplyNoMention(`Without mention.`); //Line (Inline) reply - no mention
}
});
client.login('TOKEN');
Embed
if (message.content.startsWith('!reply')) {
let embed = new discord.MessageEmbed()
.setDescription(`Reply to ${message.author}.`);
message.lineReply(embed); //Line (Inline) reply - mention
//or
message.lineReplyNoMention(embed); //Line (Inline) reply - no mention
}
if (message.content.startsWith('!ping')) {
let m = await message.lineReply('Ping');
let ping = (m.createdTimestamp - message.createdTimestamp);
m.edit(`Pong! That took ${ping}ms.`)
}
Command Handler
/**
* No need to define it
* */
module.exports = {
name: 'replytest',
category: 'Tests',
run: (client, message, args) => {
message.lineReply('This is a reply with a @mention!');
}
}