satella
Advanced tools
Comparing version 1.3.6 to 1.3.7
{ | ||
"name": "satella", | ||
"version": "1.3.6", | ||
"version": "1.3.7", | ||
"description": "Satella - A wrapper for the Discord API made in JS", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
module.exports = async (client, payload) => { | ||
if(!payload.d.channel_id) return; | ||
if(!payload.d.id) return; | ||
const channel = client.channels.dmchannels.get(payload.d.channel_id) || client.channels.channels.get(payload.d.channel_id) | ||
if(!channel) return; | ||
const message = channel.messages.get(payload.d.id); | ||
@@ -4,0 +7,0 @@ channel.messages.remove(message.id); |
@@ -35,3 +35,2 @@ const Chest = require('../Utils/Chest'); | ||
} else if (typeof subject == 'object') { | ||
subject.color = subject.color ? parseInt(subject.color.replace('#', ''), 16) : null; | ||
data = JSON.stringify({ embed: subject, tts: false }); | ||
@@ -38,0 +37,0 @@ } |
@@ -20,2 +20,4 @@ /* eslint-disable no-undef */ | ||
this._client = client | ||
this.messages = new Chest(Message, client.options.messagesCache || 100); | ||
@@ -22,0 +24,0 @@ } |
@@ -18,3 +18,3 @@ /* eslint-disable padded-blocks */ | ||
this.user = data.author ? client.users.get(data.author.id) : undefined | ||
this.member = this.guild ? this.guild.members.get(data.author.id) : undefined | ||
this.member = data.author && this.guild ? this.guild.members.get(data.author.id) : undefined | ||
@@ -35,7 +35,2 @@ this.mentions = new Mentions(client, data); | ||
} else if (typeof subject == 'object') { | ||
if(subject.color == "RANDOM"){ | ||
subject.color = Math.floor(Math.random() * 16777215) | ||
}else{ | ||
subject.color = subject.color ? parseInt(subject.color.replace('#', ''), 16) : null; | ||
} | ||
data = JSON.stringify({ embed: subject, tts: false, message_reference: { message_id: this.id, guild_id: this._data.guild_id } }); | ||
@@ -42,0 +37,0 @@ } |
@@ -0,1 +1,3 @@ | ||
const Color = require("./Color") | ||
module.exports = class Embed { | ||
@@ -34,7 +36,4 @@ constructor(data){ | ||
setColor(color){ | ||
if(color == "RANDOM"){ | ||
this.color = Math.floor(Math.random() * 16777215) | ||
}else{ | ||
this.color = parseInt(color.replace("#", ""), 16) | ||
} | ||
if(!new Color(color).valid) throw new Error("Invalid Color!") | ||
this.color = parseInt(new Color(color).hsl, 16) | ||
return this; | ||
@@ -41,0 +40,0 @@ } |
50148
34
1394