Comparing version 1.2.7 to 1.2.8
{ | ||
"name": "satella", | ||
"version": "1.2.7", | ||
"version": "1.2.8", | ||
"description": "Satella - A wrapper for the Discord API made in JS", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -8,3 +8,3 @@ /* eslint-disable no-undef */ | ||
constructor(client, data) { | ||
this.type = 1 | ||
this.type = data.type | ||
this.lastMessage = data.last_message_id | ||
@@ -11,0 +11,0 @@ this.id = data.id |
@@ -14,10 +14,10 @@ const Chest = require('../Utils/Chest'); | ||
this.guild = client.guilds.get(data.guild_id); | ||
this.channel = client.channels.dmchannels.get(data.channel_id) || client.channels.channels.get(data.channel_id) | ||
this.channel = client.channels.dmchannels.get(data.channel_id) || this.guild.channels.get(data.channel_id) || undefined | ||
if(this.channel.type == 1){ | ||
if(this.channel && this.channel.type == 1){ | ||
this.user = this.channel.users.first() | ||
}else{ | ||
}else if(this.channel){ | ||
try { | ||
this.user = data.author ? client.users.get(data.author.id) : undefined || undefined; | ||
this.member = data.member ? this.guild.members.get(data.author.id) : undefined || undefined; | ||
this.user = client.users.get(data.author.id) || undefined; | ||
this.member = this.guild.members.get(data.author.id) || undefined; | ||
} catch (e) { | ||
@@ -24,0 +24,0 @@ console.log(e); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41120