Skip to content

AngeloCore/discord-reply

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

NPM version NPM downloads

NPM Banner

Install

$ npm i discord-reply

Setup

const discord = require('discord.js');
require('discord-reply'); //⚠️ IMPORTANT: put this before your discord.Client()
const client = new discord.Client();

Discord.js

Example

const discord = require('discord.js');
require('discord-reply'); //⚠️ IMPORTANT: put this before your discord.Client()
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('Hey'); //Line (Inline) Reply with mention

    message.lineReplyNoMention(`My name is ${client.user.username}`); //Line (Inline) Reply without 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 with mention

  //or

  message.lineReplyNoMention(embed); //Line (Inline) Reply without mention
}

Edit

(Async Function)

if (message.content.startsWith('!ping')) {

  let m = await message.lineReply('Ping');

  let ping = (m.createdTimestamp - message.createdTimestamp);

  m.edit(`${ping}ms`)
}

Command Handler

/**
 * No need to define it
 * */
module.exports = {
  name: 'reply',
  category: 'Test',
  run: (client, message, args) => {
    message.lineReply('This is reply with @mention');
  }
}

Eris

SOON


Contact

Youtube, Discord

About

An discord.js extension to inline reply messages

Resources

License

Stars

Watchers

Forks

Packages

No packages published