2.3.0 • Published 3 years ago

djs-linereply v2.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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');
  }
}

2.3.0

3 years ago

2.2.1

3 years ago

2.2.0

3 years ago

2.1.1

3 years ago

2.1.0

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.1.1

3 years ago

1.0.0

3 years ago