feat: Super Reaction

test: 
This commit is contained in:
Elysia
2023-05-02 22:37:37 +07:00
parent f4dbc57f42
commit 11167aed25
6 changed files with 51 additions and 6 deletions

View File

@@ -205,9 +205,10 @@ class MessageManager extends CachedManager {
* Adds a reaction to a message, even if it's not cached.
* @param {MessageResolvable} message The message to react to
* @param {EmojiIdentifierResolvable} emoji The emoji to react with
* @param {boolean} [burst=false] Super Reactions (Discord Nitro only)
* @returns {Promise<void>}
*/
async react(message, emoji) {
async react(message, emoji, burst = false) {
message = this.resolveId(message);
if (!message) throw new TypeError('INVALID_TYPE', 'message', 'MessageResolvable');
@@ -219,7 +220,15 @@ class MessageManager extends CachedManager {
: encodeURIComponent(emoji.name);
// eslint-disable-next-line newline-per-chained-call
await this.client.api.channels(this.channel.id).messages(message).reactions(emojiId, '@me').put();
await this.client.api
.channels(this.channel.id)
.messages(message)
.reactions(emojiId, '@me')
.put({
query: {
type: burst ? 1 : 0,
},
});
}
/**