mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 22:11:53 +00:00
fix things (#2116)
This commit is contained in:
parent
f13c6d0768
commit
aaa92c0b05
1 changed files with 4 additions and 3 deletions
|
|
@ -150,11 +150,12 @@ class ClientApplication extends Base {
|
|||
* @returns {Promise<Object>}
|
||||
*/
|
||||
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 => ({
|
||||
id: a.id,
|
||||
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) {
|
||||
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,
|
||||
data: b64,
|
||||
type: ClientApplicationAssetTypes[type.toUpperCase()],
|
||||
|
|
|
|||
Loading…
Reference in a new issue