diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-09-03 10:40:20 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-09-03 10:40:20 -0400 |
commit | 0d73d6956ae2b23ad12a677749a60967bfa0bb55 (patch) | |
tree | 3bd4c510293d4a2be1526fd521d70f9f249aa23f /src/lib/extensions/discord-akairo | |
parent | 87d58eb925d0bde22626eb3a1e9ea03ab97d3a29 (diff) | |
download | tanzanite-0d73d6956ae2b23ad12a677749a60967bfa0bb55.tar.gz tanzanite-0d73d6956ae2b23ad12a677749a60967bfa0bb55.tar.bz2 tanzanite-0d73d6956ae2b23ad12a677749a60967bfa0bb55.zip |
add method arguments
Diffstat (limited to 'src/lib/extensions/discord-akairo')
-rw-r--r-- | src/lib/extensions/discord-akairo/BushClientUtil.ts | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/lib/extensions/discord-akairo/BushClientUtil.ts b/src/lib/extensions/discord-akairo/BushClientUtil.ts index 56e2c13..f759d22 100644 --- a/src/lib/extensions/discord-akairo/BushClientUtil.ts +++ b/src/lib/extensions/discord-akairo/BushClientUtil.ts @@ -1448,10 +1448,21 @@ export class BushClientUtil extends ClientUtil { (i == 0 || p !== arr[i - 1]) && //not overriding in this prototype props.indexOf(p) === -1 //not overridden in a child ); - l.forEach((p) => console.debug(Object.getOwnPropertyDescriptor(obj, p))); + const reg = /\(([\s\S]*?)\)/; props = props.concat( - l.map((p) => (obj[p] && obj[p][Symbol.toStringTag] === 'AsyncFunction' ? `async ${p}();` : `${p}();`)) + l.map( + (p) => + `${obj[p] && obj[p][Symbol.toStringTag] === 'AsyncFunction' ? 'async ' : ''}function ${p}(${ + reg.exec(obj[p].toString())?.[1] + ? reg + .exec(obj[p].toString())?.[1] + .split(', ') + .map((arg) => arg.split('=')[0].trim()) + .join(', ') + : '' + });` + ) ); } while ( (obj = Object.getPrototypeOf(obj)) && //walk-up the prototype chain |