mirror of
https://github.com/danbulant/discord.js
synced 2026-06-08 17:21:31 +00:00
Add message.system
This commit is contained in:
parent
0860d5210b
commit
907c1ed9f9
2 changed files with 16 additions and 1 deletions
File diff suppressed because one or more lines are too long
|
|
@ -140,6 +140,15 @@ class Message {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether or not this message was sent by Discord, not actually a user (e.g. pin notifications)
|
||||||
|
* @type {Boolean}
|
||||||
|
*/
|
||||||
|
this.system = false;
|
||||||
|
if (data.type === 6) {
|
||||||
|
this.system = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
patch(data) {
|
patch(data) {
|
||||||
|
|
@ -170,6 +179,12 @@ class Message {
|
||||||
if (data.embeds) {
|
if (data.embeds) {
|
||||||
this.embeds = data.embeds.map(e => new Embed(this, e));
|
this.embeds = data.embeds.map(e => new Embed(this, e));
|
||||||
}
|
}
|
||||||
|
if (data.type > -1) {
|
||||||
|
this.system = false;
|
||||||
|
if (data.type === 6) {
|
||||||
|
this.system = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (data.attachments) {
|
if (data.attachments) {
|
||||||
this.attachments = new Collection();
|
this.attachments = new Collection();
|
||||||
for (const attachment of data.attachments) {
|
for (const attachment of data.attachments) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue