Skip to content

Instantly share code, notes, and snippets.

Avatar
🐊
Nom nom nom

Matthew MrCrypticxDev

🐊
Nom nom nom
View GitHub Profile
@MrCrypticxDev
MrCrypticxDev / ExtendedMessage.js
Created Feb 16, 2021 — forked from Allvaa/ExtendedMessage.js
Discord.js v12 Inline Replies (use discord.js's Message#reply instead because the PR has been merged)
View ExtendedMessage.js
const { APIMessage, Structures } = require("discord.js");
class Message extends Structures.get("Message") {
async inlineReply(content, options) {
const mentionRepliedUser = typeof ((options || content || {}).allowedMentions || {}).repliedUser === "undefined" ? true : ((options || content).allowedMentions).repliedUser;
delete ((options || content || {}).allowedMentions || {}).repliedUser;
const apiMessage = content instanceof APIMessage ? content.resolveData() : APIMessage.create(this.channel, content, options).resolveData();
Object.assign(apiMessage.data, { message_reference: { message_id: this.id } });