fix(Message): make #channel and #guild getters (#6271)

This commit is contained in:
Souji
2021-08-04 22:47:32 +02:00
committed by GitHub
parent 5b0621fb3a
commit 6e3236ab64
11 changed files with 41 additions and 25 deletions

View File

@@ -28,7 +28,7 @@ class MessageManager extends CachedManager {
*/
_add(data, cache) {
return super._add(data, cache, { extras: [this.channel] });
return super._add(data, cache);
}
/**

View File

@@ -58,7 +58,7 @@ class ReactionManager extends CachedManager {
* @returns {Promise<Message>}
*/
async removeAll() {
await this.client.api.channels(this.message.channel.id).messages(this.message.id).reactions.delete();
await this.client.api.channels(this.message.channelId).messages(this.message.id).reactions.delete();
return this.message;
}
}

View File

@@ -40,7 +40,7 @@ class ReactionUserManager extends CachedManager {
*/
async fetch({ limit = 100, after } = {}) {
const message = this.reaction.message;
const data = await this.client.api.channels[message.channel.id].messages[message.id].reactions[
const data = await this.client.api.channels[message.channelId].messages[message.id].reactions[
this.reaction.emoji.identifier
].get({ query: { limit, after } });
const users = new Collection();
@@ -61,7 +61,7 @@ class ReactionUserManager extends CachedManager {
const userId = this.client.users.resolveId(user);
if (!userId) throw new Error('REACTION_RESOLVE_USER');
const message = this.reaction.message;
await this.client.api.channels[message.channel.id].messages[message.id].reactions[this.reaction.emoji.identifier][
await this.client.api.channels[message.channelId].messages[message.id].reactions[this.reaction.emoji.identifier][
userId === this.client.user.id ? '@me' : userId
].delete();
return this.reaction;