mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 02:53:31 +01:00
fix things (#2116)
This commit is contained in:
@@ -150,11 +150,12 @@ class ClientApplication extends Base {
|
|||||||
* @returns {Promise<Object>}
|
* @returns {Promise<Object>}
|
||||||
*/
|
*/
|
||||||
fetchAssets() {
|
fetchAssets() {
|
||||||
return this.client.api.applications(this.id).assets.get()
|
const types = Object.keys(ClientApplicationAssetTypes);
|
||||||
|
return this.client.api.oauth2.applications(this.id).assets.get()
|
||||||
.then(assets => assets.map(a => ({
|
.then(assets => assets.map(a => ({
|
||||||
id: a.id,
|
id: a.id,
|
||||||
name: a.name,
|
name: a.name,
|
||||||
type: Object.keys(ClientApplicationAssetTypes)[a.type - 1],
|
type: types[a.type - 1],
|
||||||
})));
|
})));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,7 +168,7 @@ class ClientApplication extends Base {
|
|||||||
*/
|
*/
|
||||||
createAsset(name, data, type) {
|
createAsset(name, data, type) {
|
||||||
return DataResolver.resolveBase64(data).then(b64 =>
|
return DataResolver.resolveBase64(data).then(b64 =>
|
||||||
this.client.api.applications(this.id).assets.post({ data: {
|
this.client.api.oauth2.applications(this.id).assets.post({ data: {
|
||||||
name,
|
name,
|
||||||
data: b64,
|
data: b64,
|
||||||
type: ClientApplicationAssetTypes[type.toUpperCase()],
|
type: ClientApplicationAssetTypes[type.toUpperCase()],
|
||||||
|
|||||||
Reference in New Issue
Block a user