mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 08:33:30 +01:00
Datastore cleanup (#1892)
* Start Store cleanup * wip store cleanup * fix iterables initiating datastores * handle the possibility of a datastore with no holds and no its own 'create' method * more cleanup (instances that need more than just client/data) * missed RoleStore extras * not sure how eslint didn't catch that tab... * avoid re-getting the channel we already have... * cleanup resolvers and refactor them into DataStores * ^ * and remove * fix some bugs * fix lint * fix documentation maybe? * formatting * fix presences * really fix presences this time * bad fix was bad... let;s see how bad this one is.. * forgot to save a file * make presence resolving take userresolveables too * fix tabs in jsdocs * fix bad fix from last night that caused issues, with better fix... * oops
This commit is contained in:
@@ -4,6 +4,7 @@ const ClientUserSettings = require('./ClientUserSettings');
|
||||
const ClientUserGuildSettings = require('./ClientUserGuildSettings');
|
||||
const Constants = require('../util/Constants');
|
||||
const Util = require('../util/Util');
|
||||
const DataResolver = require('../util/DataResolver');
|
||||
const Guild = require('./Guild');
|
||||
|
||||
/**
|
||||
@@ -177,7 +178,7 @@ class ClientUser extends User {
|
||||
* .catch(console.error);
|
||||
*/
|
||||
async setAvatar(avatar) {
|
||||
return this.edit({ avatar: await this.client.resolver.resolveImage(avatar) });
|
||||
return this.edit({ avatar: await DataResolver.resolveImage(avatar, this.client.browser) });
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -293,7 +294,7 @@ class ClientUser extends User {
|
||||
);
|
||||
}
|
||||
|
||||
return this.client.resolver.resolveImage(icon)
|
||||
return DataResolver.resolveImage(icon, this.client.browser)
|
||||
.then(data => this.createGuild(name, { region, icon: data || null }));
|
||||
}
|
||||
|
||||
@@ -320,7 +321,7 @@ class ClientUser extends User {
|
||||
if (r.nick) o[r.user ? r.user.id : r.id] = r.nick;
|
||||
return o;
|
||||
}, {}),
|
||||
} : { recipients: recipients.map(u => this.client.resolver.resolveUserID(u.user || u.id)) };
|
||||
} : { recipients: recipients.map(u => this.client.users.resolveID(u.user || u.id)) };
|
||||
return this.client.api.users('@me').channels.post({ data })
|
||||
.then(res => this.client.channels.create(res));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user