Add message.system

This commit is contained in:
Amish Shah
2016-08-30 13:47:47 +01:00
parent 0860d5210b
commit 907c1ed9f9
2 changed files with 16 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@@ -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) {
@@ -170,6 +179,12 @@ class Message {
if (data.embeds) {
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) {
this.attachments = new Collection();
for (const attachment of data.attachments) {