From 33ccdd0f0fa76328d32bc7ce2a83822c92998dc9 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Fri, 29 Jul 2022 15:09:19 +0300 Subject: [PATCH] allow resolve result to be nullable --- package.json | 2 +- src/interfaces/Resolver.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 988d7c4..ed26c19 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "commandparser", - "version": "1.0.4", + "version": "1.0.5", "description": "Parser meant to parse commands and their options for discord bots", "main": "index.ts", "author": "Navy.gif", diff --git a/src/interfaces/Resolver.ts b/src/interfaces/Resolver.ts index 1a925dc..64ddee2 100644 --- a/src/interfaces/Resolver.ts +++ b/src/interfaces/Resolver.ts @@ -8,7 +8,7 @@ interface IResolver { * @return {User} {User} * @memberof IResolver */ - resolveUser(resolveable: string, strict?: boolean): User + resolveUser(resolveable: string, strict?: boolean): User | null /** * Should resolve to a member abstraction @@ -19,7 +19,7 @@ interface IResolver { * @return {Member} {Member} * @memberof IResolver */ - resolveMember(resolveable: string, strict?: boolean, guild?: Guild): Member + resolveMember(resolveable: string, strict?: boolean, guild?: Guild): Member | null /** * Should resolve to a role abstraction @@ -30,7 +30,7 @@ interface IResolver { * @return {Channel} {Channel} * @memberof IResolver */ - resolveChannel(resolveable: string, strict?: boolean, guild?: Guild): Channel + resolveChannel(resolveable: string, strict?: boolean, guild?: Guild): Channel | null /** * Should resolve to a role abstraction @@ -41,7 +41,7 @@ interface IResolver { * @return {Role} {Role} * @memberof IResolver */ - resolveRole(resolveable: string, strict?: boolean, guild?: Guild): Role + resolveRole(resolveable: string, strict?: boolean, guild?: Guild): Role | null /** * Should resolve to true when a truthy resolveable is passed, i.e. yes, true, on etc @@ -62,7 +62,7 @@ interface IResolver { * @return {number} {number} * @memberof IResolver */ - resolveTime(resolveable: string): number + resolveTime(resolveable: string): number | null }