diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-10-21 23:35:13 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-10-21 23:35:13 -0400 |
commit | 44521f4560dc8b0bab055685437d8fa65a34377f (patch) | |
tree | 4750c8cf696a2489964edc409e640f6792ed92b6 /src/arguments | |
parent | a8b3f2d258d6ef19aeff2c9d60d6b08a91277b2b (diff) | |
download | tanzanite-44521f4560dc8b0bab055685437d8fa65a34377f.tar.gz tanzanite-44521f4560dc8b0bab055685437d8fa65a34377f.tar.bz2 tanzanite-44521f4560dc8b0bab055685437d8fa65a34377f.zip |
misc
Diffstat (limited to 'src/arguments')
-rw-r--r-- | src/arguments/permission.ts | 2 | ||||
-rw-r--r-- | src/arguments/roleWithDuation.ts | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/arguments/permission.ts b/src/arguments/permission.ts index 8ad0102..3275c49 100644 --- a/src/arguments/permission.ts +++ b/src/arguments/permission.ts @@ -4,7 +4,7 @@ import { BushArgumentTypeCaster } from '../lib/extensions/discord-akairo/BushArg export const permissionTypeCaster: BushArgumentTypeCaster = (_, phrase) => { if (!phrase) return null; phrase = phrase.toUpperCase().replace(/ /g, '_'); - if (!Permissions.FLAGS[phrase as keyof typeof Permissions.FLAGS]) { + if (!Reflect.has(Permissions.FLAGS, phrase)) { return null; } else { return phrase; diff --git a/src/arguments/roleWithDuation.ts b/src/arguments/roleWithDuation.ts index a63026d..50f54e2 100644 --- a/src/arguments/roleWithDuation.ts +++ b/src/arguments/roleWithDuation.ts @@ -8,9 +8,7 @@ export const roleWithDurationTypeCaster: BushArgumentTypeCaster = async ( let { duration, contentWithoutTime } = client.util.parseDuration(phrase); if (contentWithoutTime === null || contentWithoutTime === undefined) return null; contentWithoutTime = contentWithoutTime.trim(); - const role = await util.arg.cast('role', client.commandHandler.resolver, message, contentWithoutTime); - if (!role) { - return null; - } + const role = await util.arg.cast('role', message, contentWithoutTime); + if (!role) return null; return { duration, role }; }; |