mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
Fix recipient resolution
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -49,7 +49,7 @@ class ClientDataManager {
|
||||
if (data.type === Constants.ChannelTypes.DM) {
|
||||
channel = new DMChannel(this.client, data);
|
||||
} else {
|
||||
guild = guild || this.get('guilds', data.guild_id);
|
||||
guild = guild || this.client.guilds.get(data.guild_id);
|
||||
if (guild) {
|
||||
if (data.type === Constants.ChannelTypes.text) {
|
||||
channel = new TextChannel(guild, data);
|
||||
|
||||
@@ -20,7 +20,7 @@ class DMChannel extends Channel {
|
||||
* The recipient on the other end of the DM
|
||||
* @type {User}
|
||||
*/
|
||||
this.recipient = this.client.users.set(recipient.id, recipient);
|
||||
this.recipient = recipient;
|
||||
/**
|
||||
* The ID of the last sent message, if available
|
||||
* @type {?String}
|
||||
|
||||
@@ -3,10 +3,7 @@
|
||||
const Discord = require('../');
|
||||
const request = require('superagent');
|
||||
|
||||
const client = new Discord.Client({
|
||||
shard_id: 0,
|
||||
shard_count: 2,
|
||||
});
|
||||
const client = new Discord.Client();
|
||||
|
||||
client.login(require('./auth.json').token).then(token => console.log('logged in with token ' + token)).catch(console.log);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user