Skip to content

Commit

Permalink
Support stickers (receive-only)
Browse files Browse the repository at this point in the history
Co-authored-by: Dragory <[email protected]>
Co-authored-by: Gleb Koval <[email protected]>
  • Loading branch information
3 people committed Mar 24, 2021
1 parent c82c6a0 commit 9cd3a5d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
16 changes: 16 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,16 @@ declare namespace Eris {
guildID?: string;
messageID?: string;
}
interface Sticker {
id: string;
name: string;
description: string;
pack_id: string;
tags?: string;
asset: string;
preview_asset?: string;
format_type: Constants["StickerFormats"][keyof Constants["StickerFormats"]];
}

// Presence
interface Activity extends ActivityPartial<ActivityType> {
Expand Down Expand Up @@ -1060,6 +1070,11 @@ declare namespace Eris {
allVoice: 871367441;
};
REST_VERSION: 7;
StickerFormats: {
PNG: 1;
APNG: 2;
LOTTIE: 3;
};
SystemJoinMessages: [
"%user% joined the party.",
"%user% is here.",
Expand Down Expand Up @@ -2041,6 +2056,7 @@ declare namespace Eris {
reactions: { [s: string]: { count: number; me: boolean } };
referencedMessage?: Message | null;
roleMentions: string[];
stickers?: Sticker[];
timestamp: number;
tts: boolean;
type: number;
Expand Down
4 changes: 4 additions & 0 deletions lib/structures/Message.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const User = require("./User");
* @prop {Object} reactions An object containing the reactions on the message. Each key is a reaction emoji and each value is an object with properties `me` (Boolean) and `count` (Number) for that specific reaction emoji.
* @prop {Message?} referencedMessage The message that was replied to. If undefined, message data was not received. If null, the message was deleted.
* @prop {Array<String>} roleMentions Array of mentioned roles' ids
* @prop {Array<Object>?} stickers The stickers sent with the message
* @prop {Number} timestamp Timestamp of message creation
* @prop {Boolean} tts Whether to play the message using TTS or not
* @prop {Number} type The type of the message
Expand Down Expand Up @@ -251,6 +252,9 @@ class Message extends Base {
};
});
}
if(data.stickers !== undefined) {
this.stickers = data.stickers;
}
}

get channelMentions() {
Expand Down

0 comments on commit 9cd3a5d

Please sign in to comment.