devland.js
Advanced tools
Comparing version 1.4.3 to 1.4.4
@@ -12,3 +12,3 @@ { | ||
"name": "devland.js", | ||
"version": "1.4.3", | ||
"version": "1.4.4", | ||
"description": "A powerful API wrapper for the Discord API designed for modern bots", | ||
@@ -15,0 +15,0 @@ "main": "index.js", |
@@ -479,2 +479,7 @@ const { EventEmitter } = require('events') | ||
else if (channel.type === 15) channel = new ForumChannel(this, guild, channel) | ||
else if (channel.type === 4) { | ||
channel = new CategoryChannel(this, guild, channel) | ||
channel.childrens = [] | ||
this.allChannels.filter(child => child.parent_id === channel.id || child.parentId === channel.id).map(child => channel.childrens.push(child.id)) | ||
} | ||
return resolve(channel) | ||
@@ -481,0 +486,0 @@ } else { |
@@ -558,2 +558,29 @@ const Client = require('../client/client') | ||
getFocusedName(){ | ||
if(!this.isAutoCompleteRequest) throw new TypeError("This function can be used on a auto complete request") | ||
if (!this.data) return this.client.options.invalidCommandValueReturnNull ? null : undefined | ||
if (!this.data?.options || this.data?.options?.length < 1) return this.client.options.invalidCommandValueReturnNull ? null : undefined | ||
let value = this.data.options.find(option => option.focused)?.name | ||
if (!value) return this.client.options.invalidCommandValueReturnNull ? null : undefined | ||
return value | ||
} | ||
getFocusedType(){ | ||
if(!this.isAutoCompleteRequest) throw new TypeError("This function can be used on a auto complete request") | ||
if (!this.data) return this.client.options.invalidCommandValueReturnNull ? null : undefined | ||
if (!this.data?.options || this.data?.options?.length < 1) return this.client.options.invalidCommandValueReturnNull ? null : undefined | ||
let value = this.data.options.find(option => option.focused)?.type | ||
if (!value) return this.client.options.invalidCommandValueReturnNull ? null : undefined | ||
return value | ||
} | ||
getFocusedValue(){ | ||
if(!this.isAutoCompleteRequest) throw new TypeError("This function can be used on a auto complete request") | ||
if (!this.data) return this.client.options.invalidCommandValueReturnNull ? null : undefined | ||
if (!this.data?.options || this.data?.options?.length < 1) return this.client.options.invalidCommandValueReturnNull ? null : undefined | ||
let value = this.data.options.find(option => option.focused)?.value | ||
if (!value) return this.client.options.invalidCommandValueReturnNull ? null : undefined | ||
return value | ||
} | ||
getTargetUser() { | ||
@@ -560,0 +587,0 @@ if (!this.isUserContext) throw new TypeError("This function can be used on a user context only") |
@@ -234,3 +234,3 @@ const Utils = require('../util') | ||
if (typeof type !== "string" || type === "auto") type = user.banner.startsWith('a_') ? 'gif' : 'png' | ||
else return resolve(`https://cdn.discordapp.com/banners/${this.id}/${user.banner}.${type}?size=${size}`) | ||
return resolve(`https://cdn.discordapp.com/banners/${this.id}/${user.banner}.${type}?size=${size}`) | ||
}) | ||
@@ -244,5 +244,5 @@ } | ||
if (typeof type !== "string" || type === "auto") type = user.avatar.startsWith('a_') ? 'gif' : 'png' | ||
else return resolve(`https://cdn.discordapp.com/avatars/${this.id}/${user.avatar}.${type}?size=${size}`) | ||
return resolve(`https://cdn.discordapp.com/avatars/${this.id}/${user.avatar}.${type}?size=${size}`) | ||
}) | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1715954
18979