discord-reply-wrapper
v1.0.1
Published
Replaces Message.reply in discord.js with an inline reply
Downloads
2
Maintainers
Readme
Discord Reply Wrapper
About
This package wraps discord-reply and replaces Message.reply
with inline replies rather than prepending a mention.
This is meant to make it easy to change your current code and have to do little changes when inline .reply
is implemented in [email protected].
Usage
/*
* Important: require() this module before
* creating your client.
*/
require("discord-reply-wrapper");
const Discord = require("discord.js"),
{Client} = Discord;
const client = new Client();
client.on("message", (message) => {
// With mention
message.reply("I am mentioning you!");
// Without mention
message.reply("I am not mentioning you!", {
allowedMentions: {
repliedUser: false
}
});
// Using embeds
message.reply({
embed: {
title: "This is a title"
}
});
});
client.login("TOKEN");
Documentation
.reply([content], [options])
Replies to the message inline
|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION|
|---------|----|--------|-------|-----------|
|content |StringResolvable or APIMessage|Yes|""
|The content for the message|
|options|MessageOptions or MessageAdditions|Yes|{}
|The options to provide|
Returns: Promise<(Message|Array<Message>)>
Examples:
// Reply to a message (inline)
message.reply('Hey, I\'m a reply!', {
allowedMentions: {
repliedUser: false
}
})
.then(() => console.log(`Sent a reply to ${message.author.username}`))
.catch(console.error);
More Information
The Discord API takes a replied_user
field, which is currently implemented as repliedUser
in discord.js's GitHub repository in their MessageMentionOptions.
Default value for repliedUser
is true