devland.js
Advanced tools
Comparing version 1.1.9 to 1.1.10
@@ -10,3 +10,3 @@ { | ||
"name": "devland.js", | ||
"version": "1.1.9", | ||
"version": "1.1.10", | ||
"description": "A powerful API wrapper for the Discord API designed for modern bots", | ||
@@ -13,0 +13,0 @@ "main": "index.js", |
@@ -156,3 +156,3 @@ const { EventEmitter } = require('events') | ||
}, | ||
ping: null | ||
ping: -1 | ||
} | ||
@@ -159,0 +159,0 @@ |
const Client = require('../../client/client') | ||
const { Guild, TextChannel, Message, DmChannel, User } = require('../../models') | ||
const { Guild, TextChannel, Message, DmChannel, User, Member } = require('../../models') | ||
module.exports = { | ||
@@ -35,2 +35,10 @@ name: 'message', | ||
if (!channel) return | ||
let member; | ||
if(!data.webhook_id) member = guild.members.get(data.author?.id) || await client.rest.get(client._ENDPOINTS.MEMBERS(guild.id, data.author?.id)) | ||
let user; | ||
if(member && !(member instanceof Member) && !member.user) user = client.users.get(data.author?.id) || await client.rest.get(client._ENDPOINTS.USER(data.author?.id)) | ||
if(user && !(user instanceof User)) user = new User(client, user) | ||
if(user && !member.user) member.user = user | ||
if(member && !(member instanceof Member)) member = new Member(client, guild, member) | ||
data.member = member | ||
let message = new Message(client, guild, new TextChannel(client, guild, channel), data) | ||
@@ -37,0 +45,0 @@ /** |
const Client = require('../../client/client') | ||
const { Guild, TextChannel, Message, DmChannel } = require('../../models') | ||
const { Guild, TextChannel, Message, DmChannel, Member, User } = require('../../models') | ||
module.exports = { | ||
@@ -49,2 +49,10 @@ name: 'messageUpdate', | ||
if (!channel) return | ||
let member; | ||
if(!data.webhook_id) member = guild.members.get(data.author?.id) || await client.rest.get(client._ENDPOINTS.MEMBERS(guild.id, data.author?.id)) | ||
let user; | ||
if(member && !(member instanceof Member) && !member.user) user = client.users.get(data.author?.id) || await client.rest.get(client._ENDPOINTS.USER(data.author?.id)) | ||
if(user && !(user instanceof User)) user = new User(client, user) | ||
if(user && !member.user) member.user = user | ||
if(member && !(member instanceof Member)) member = new Member(client, guild, member) | ||
data.member = member | ||
let message = new Message(client, guild, new TextChannel(client, guild, channel), data) | ||
@@ -51,0 +59,0 @@ |
@@ -66,3 +66,3 @@ const Client = require('../client/client') | ||
this.authorId = this.webhookId ? this.webhookId : data.author.id | ||
this.member = this.webhookId ? null : this.guildId ? this.guild.members.get(this.authorId) : null | ||
this.member = this.webhookId ? null : this.guildId ? this.member ? this.member : this.guild.members.get(this.authorId) : null | ||
this.interaction = data.interaction | ||
@@ -69,0 +69,0 @@ this.data_is_available = true |
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
721831
12618