# discord-reply-wrapper

> Replaces Message.reply in discord.js with an inline reply

Latest version **1.0.1** (published 2021-05-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install discord-reply-wrapper
pnpm add discord-reply-wrapper
yarn add discord-reply-wrapper
bun add discord-reply-wrapper
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2021-05-18 |
| First published | 2021-05-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | theusaf |
| Maintainers | theusaf |
| Keywords | discord.js, reply, discord.js, inline |

## Links

- npm: https://www.npmjs.com/package/discord-reply-wrapper
- Repository: https://github.com/theusaf/discord-reply-wrapper
- Homepage: https://github.com/theusaf/discord-reply-wrapper#readme
- Issues: https://github.com/theusaf/discord-reply-wrapper/issues
- npm.io page: https://npm.io/package/discord-reply-wrapper

## Dependencies (2)

- [discord.js](https://npm.io/package/discord.js.md) ^12.5.3
- [discord-reply](https://npm.io/package/discord-reply.md) ^0.1.2

## Recent versions

- 1.0.1 (latest) — 2021-05-18
- 1.0.0 — 2021-05-18

## README

# Discord Reply Wrapper

## About
This package wraps [discord-reply](https://npmjs.com/package/discord-reply) and replaces [`Message.reply`](https://discord.js.org/#/docs/main/stable/class/Message?scrollTo=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 discord.js@13.0.0.

## Usage
```js
/*
 * 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](https://discord.js.org/#/docs/main/stable/typedef/StringResolvable) or [APIMessage](https://discord.js.org/#/docs/main/stable/class/APIMessage)|Yes|`""`|The content for the message|
|options|[MessageOptions](https://discord.js.org/#/docs/main/stable/typedef/MessageOptions) or [MessageAdditions](https://discord.js.org/#/docs/main/stable/typedef/MessageAdditions)|Yes|`{}`|The options to provide|

> Returns: [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<([Message](https://discord.js.org/#/docs/main/stable/class/Message)|[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Message](https://discord.js.org/#/docs/main/stable/class/Message)>)>

Examples:

```js
// 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](https://github.com/discordjs/discord.js/blob/master/src/structures/APIMessage.js#L173) in their [MessageMentionOptions](https://discord.js.org/#/docs/main/stable/typedef/MessageMentionOptions).

Default value for `repliedUser` is `true`

---
_Source: https://npm.io/package/discord-reply-wrapper · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
