mirror of
https://github.com/danbulant/discord.js
synced 2026-07-08 12:40:50 +00:00
Merge branch 'indev-rewrite' of https://github.com/hydrabolt/discord.js into indev-rewrite
This commit is contained in:
commit
727f3de45b
1 changed files with 4 additions and 4 deletions
|
|
@ -18,7 +18,7 @@ class ClientDataManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
newGuild(data) {
|
newGuild(data) {
|
||||||
const already = this.client.guilds.get(data.id);
|
const already = this.client.guilds.has(data.id);
|
||||||
const guild = new Guild(this.client, data);
|
const guild = new Guild(this.client, data);
|
||||||
this.client.guilds.set(guild.id, guild);
|
this.client.guilds.set(guild.id, guild);
|
||||||
if (this.pastReady && !already) {
|
if (this.pastReady && !already) {
|
||||||
|
|
@ -35,7 +35,7 @@ class ClientDataManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
newUser(data) {
|
newUser(data) {
|
||||||
if (this.client.users.get(data.id)) {
|
if (this.client.users.has(data.id)) {
|
||||||
return this.client.users.get(data.id);
|
return this.client.users.get(data.id);
|
||||||
}
|
}
|
||||||
const user = new User(this.client, data);
|
const user = new User(this.client, data);
|
||||||
|
|
@ -45,7 +45,7 @@ class ClientDataManager {
|
||||||
|
|
||||||
newChannel(data, $guild) {
|
newChannel(data, $guild) {
|
||||||
let guild = $guild;
|
let guild = $guild;
|
||||||
const already = this.client.channels.get(data.id);
|
const already = this.client.channels.has(data.id);
|
||||||
let channel;
|
let channel;
|
||||||
if (data.type === Constants.ChannelTypes.DM) {
|
if (data.type === Constants.ChannelTypes.DM) {
|
||||||
channel = new DMChannel(this.client, data);
|
channel = new DMChannel(this.client, data);
|
||||||
|
|
@ -76,7 +76,7 @@ class ClientDataManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
killGuild(guild) {
|
killGuild(guild) {
|
||||||
const already = this.client.guilds.get(guild.id);
|
const already = this.client.guilds.has(guild.id);
|
||||||
this.client.guilds.delete(guild.id);
|
this.client.guilds.delete(guild.id);
|
||||||
if (already && this.pastReady) {
|
if (already && this.pastReady) {
|
||||||
this.client.emit(Constants.Events.GUILD_DELETE, guild);
|
this.client.emit(Constants.Events.GUILD_DELETE, guild);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue