mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
Gateway v6 support
This commit is contained in:
@@ -39,12 +39,14 @@ var Message = (function (_Equality) {
|
||||
_classCallCheck(this, Message);
|
||||
|
||||
_Equality.call(this);
|
||||
this.type = data.type;
|
||||
this.channel = channel;
|
||||
this.server = channel.server;
|
||||
this.client = client;
|
||||
this.nonce = data.nonce;
|
||||
this.attachments = data.attachments;
|
||||
this.tts = data.tts;
|
||||
this.pinned = data.pinned;
|
||||
this.embeds = data.embeds;
|
||||
this.timestamp = Date.parse(data.timestamp);
|
||||
this.everyoneMentioned = data.mention_everyone !== undefined ? data.mention_everyone : data.everyoneMentioned;
|
||||
@@ -61,7 +63,25 @@ var Message = (function (_Equality) {
|
||||
this.author = client.internal.users.add(new _User2["default"](data.author, client));
|
||||
}
|
||||
|
||||
this.content = data.content;
|
||||
if (this.type === 0) {
|
||||
this.content = data.content;
|
||||
} else if (this.type === 1) {
|
||||
this.content = this.author.mention() + " added <@" + data.mentions[0].id + ">.";
|
||||
} else if (this.type === 2) {
|
||||
if (this.author.id === data.mentions[0].id) {
|
||||
this.content = this.author.mention() + " left the group.";
|
||||
} else {
|
||||
this.content = this.author.mention() + " removed <@" + data.mentions[0].id + ">.";
|
||||
}
|
||||
} else if (this.type === 3) {
|
||||
this.content = this.author.mention() + " started a call.";
|
||||
} else if (this.type === 4) {
|
||||
this.content = this.author.mention() + " changed the channel name: " + data.content;
|
||||
} else if (this.type === 5) {
|
||||
this.content = this.author.mention() + " changed the channel icon.";
|
||||
} else if (this.type === 6) {
|
||||
this.content = this.author.mention() + " pinned a message to this channel. See all the pins.";
|
||||
}
|
||||
|
||||
var mentionData = client.internal.resolver.resolveMentions(data.content, channel);
|
||||
this.cleanContent = mentionData[1];
|
||||
|
||||
Reference in New Issue
Block a user