From e355d535b67cc4235e9d86ceb8922e3b924bb718 Mon Sep 17 00:00:00 2001 From: Navy Date: Sun, 17 May 2020 14:04:58 +0300 Subject: [PATCH] singular resolvers --- structure/client/Resolver.js | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/structure/client/Resolver.js b/structure/client/Resolver.js index 5120bc9..985b2de 100644 --- a/structure/client/Resolver.js +++ b/structure/client/Resolver.js @@ -138,7 +138,7 @@ class Resolver { async resolveUser(resolveable, strict) { let result = await this.resolveUsers([ resolveable ], strict); - return result; + return result ? result[0] : false; } /** @@ -204,7 +204,7 @@ class Resolver { async resolveMember(resolveable, guild, strict) { let result = await this.resolveMembers([ resolveable ], guild, strict); - return result; + return result ? result[0] : false; } @@ -217,7 +217,7 @@ class Resolver { * @returns {array || false} an array of guild channels or false if none were resolved * @memberof Resolver */ - async resolveChannels(resolveables = [], guild, strict = false) { + resolveChannels(resolveables = [], guild, strict = false) { if(typeof resolveables === 'string') resolveables = [ resolveables ]; if(resolveables.length === 0) return false; @@ -263,6 +263,13 @@ class Resolver { return resolved.length > 0 ? resolved : false; } + + resolveChannel(resolveable, guild, strict) { + + let result = this.resolveChannels([resolveable], guild, strict); + return result ? result[0] : false; + + } /** * Resolve multiple roles @@ -309,6 +316,13 @@ class Resolver { return resolved.length > 0 ? resolved : false; } + + async resolveRole(resolveable, guild, strict) { + + let result = await this.resolveRoles([resolveable], guild, strict); + return result ? result[0] : false; + + } }