Downgrade to v13
[vi] cảm giác đau khổ
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
const { Collection } = require('@discordjs/collection');
|
||||
const { Routes } = require('discord-api-types/v9');
|
||||
const CachedManager = require('./CachedManager');
|
||||
const { TypeError } = require('../errors');
|
||||
const MessagePayload = require('../structures/MessagePayload');
|
||||
@@ -62,14 +61,11 @@ class GuildStickerManager extends CachedManager {
|
||||
if (!resolvedFile) throw new TypeError('REQ_RESOURCE_TYPE');
|
||||
file = { ...resolvedFile, key: 'file' };
|
||||
|
||||
const body = { name, tags, description: description ?? '' };
|
||||
const data = { name, tags, description: description ?? '' };
|
||||
|
||||
const sticker = await this.client.api.guilds(this.guild.id).stickers.post({
|
||||
appendToFormData: true,
|
||||
body,
|
||||
files: [file],
|
||||
reason,
|
||||
});
|
||||
const sticker = await this.client.api
|
||||
.guilds(this.guild.id)
|
||||
.stickers.post({ data, files: [file], reason, dontUsePayloadJSON: true });
|
||||
return this.client.actions.GuildStickerCreate.handle(this.guild, sticker).sticker;
|
||||
}
|
||||
|
||||
@@ -110,7 +106,7 @@ class GuildStickerManager extends CachedManager {
|
||||
if (!stickerId) throw new TypeError('INVALID_TYPE', 'sticker', 'StickerResolvable');
|
||||
|
||||
const d = await this.client.api.guilds(this.guild.id).stickers(stickerId).patch({
|
||||
body: data,
|
||||
data,
|
||||
reason,
|
||||
});
|
||||
|
||||
@@ -165,19 +161,6 @@ class GuildStickerManager extends CachedManager {
|
||||
const data = await this.client.api.guilds(this.guild.id).stickers.get();
|
||||
return new Collection(data.map(sticker => [sticker.id, this._add(sticker, cache)]));
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the user who uploaded this sticker, if this is a guild sticker.
|
||||
* @param {StickerResolvable} sticker The sticker to fetch the user for
|
||||
* @returns {Promise<?User>}
|
||||
*/
|
||||
async fetchUser(sticker) {
|
||||
sticker = this.resolve(sticker);
|
||||
if (!sticker) throw new TypeError('INVALID_TYPE', 'sticker', 'StickerResolvable');
|
||||
const data = await this.client.api.guilds(this.guild.id).stickers(sticker.id).get();
|
||||
sticker._patch(data);
|
||||
return sticker.user;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = GuildStickerManager;
|
||||
|
||||
Reference in New Issue
Block a user