Skip to content

Instantly share code, notes, and snippets.

View MrCrypticxDev's full-sized avatar
🐊
Nom nom nom

Matthew MrCrypticxDev

🐊
Nom nom nom
View GitHub Profile
@MrCrypticxDev
MrCrypticxDev / ExtendedMessage.js
Created February 16, 2021 16:49 — forked from Allvaa/ExtendedMessage.js
Discord.js v12 Inline Replies (use discord.js's Message#reply instead because the PR has been merged)
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 } });