feat: Backport sending message flags (#7560)

This commit is contained in:
Jiralite
2022-03-02 09:32:36 +00:00
committed by GitHub
parent 1d97dcff08
commit 29d42ed319
5 changed files with 17 additions and 5 deletions

View File

@@ -148,11 +148,17 @@ class MessagePayload {
}
let flags;
if ((this.isMessage && typeof this.options.reply === 'undefined') || this.isMessageManager) {
if (
typeof this.options.flags !== 'undefined' ||
(this.isMessage && typeof this.options.reply === 'undefined') ||
this.isMessageManager
) {
// eslint-disable-next-line eqeqeq
flags = this.options.flags != null ? new MessageFlags(this.options.flags).bitfield : this.target.flags?.bitfield;
} else if (isInteraction && this.options.ephemeral) {
flags = MessageFlags.FLAGS.EPHEMERAL;
}
if (isInteraction && this.options.ephemeral) {
flags |= MessageFlags.FLAGS.EPHEMERAL;
}
let allowedMentions =