mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +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:
@@ -52,9 +52,9 @@ module.exports = function search(target, options) {
|
||||
options.minID = long.fromNumber(t).shiftLeft(22).toString();
|
||||
options.maxID = long.fromNumber(t + 864e5).shiftLeft(22).toString();
|
||||
}
|
||||
if (options.channel) options.channel = target.client.resolver.resolveChannelID(options.channel);
|
||||
if (options.author) options.author = target.client.resolver.resolveUserID(options.author);
|
||||
if (options.mentions) options.mentions = target.client.resolver.resolveUserID(options.options.mentions);
|
||||
if (options.channel) options.channel = target.client.channels.resolveID(options.channel);
|
||||
if (options.author) options.author = target.client.users.resolveID(options.author);
|
||||
if (options.mentions) options.mentions = target.client.users.resolveID(options.options.mentions);
|
||||
if (options.sortOrder) {
|
||||
options.sortOrder = { ascending: 'asc', descending: 'desc' }[options.sortOrder] || options.sortOrder;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ module.exports = function sendMessage(channel, options) { // eslint-disable-line
|
||||
|
||||
// Add the reply prefix
|
||||
if (reply && !(channel instanceof User || channel instanceof GuildMember) && channel.type !== 'dm') {
|
||||
const id = channel.client.resolver.resolveUserID(reply);
|
||||
const id = channel.client.users.resolveID(reply);
|
||||
const mention = `<@${reply instanceof GuildMember && reply.nickname ? '!' : ''}${id}>`;
|
||||
if (split) split.prepend = `${mention}, ${split.prepend || ''}`;
|
||||
content = `${mention}${typeof content !== 'undefined' ? `, ${content}` : ''}`;
|
||||
|
||||
Reference in New Issue
Block a user