aboutsummaryrefslogtreecommitdiff
path: root/src/lib/extensions/discord-akairo/BushClientUtil.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-08-16 10:04:46 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-08-16 10:04:46 -0400
commit4501e9f3bdd016736844146020e6b2c15e2ab3d2 (patch)
tree6e8a7c3d2b11dac7dcfd6afe0c46e4f42e682da3 /src/lib/extensions/discord-akairo/BushClientUtil.ts
parent59087bf0d8fa504da997594fc62787695e689476 (diff)
downloadtanzanite-4501e9f3bdd016736844146020e6b2c15e2ab3d2.tar.gz
tanzanite-4501e9f3bdd016736844146020e6b2c15e2ab3d2.tar.bz2
tanzanite-4501e9f3bdd016736844146020e6b2c15e2ab3d2.zip
add viewraw context menu command
Diffstat (limited to 'src/lib/extensions/discord-akairo/BushClientUtil.ts')
-rw-r--r--src/lib/extensions/discord-akairo/BushClientUtil.ts27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/lib/extensions/discord-akairo/BushClientUtil.ts b/src/lib/extensions/discord-akairo/BushClientUtil.ts
index 2a01f6a..4f9f09b 100644
--- a/src/lib/extensions/discord-akairo/BushClientUtil.ts
+++ b/src/lib/extensions/discord-akairo/BushClientUtil.ts
@@ -1371,4 +1371,31 @@ export class BushClientUtil extends ClientUtil {
public async sleep(s: number): Promise<unknown> {
return new Promise((resolve) => setTimeout(resolve, s * 1000));
}
+
+ // modified from https://stackoverflow.com/questions/31054910/get-functions-methods-of-a-class
+ // answer by Bruno Grieder
+ // public getMethods(obj: any): string {
+ // let props = [];
+
+ // do {
+ // const l = Object.getOwnPropertyNames(obj)
+ // .concat(Object.getOwnPropertySymbols(obj).map((s) => s.toString()))
+ // .sort()
+ // .filter(
+ // (p, i, arr) =>
+ // typeof obj[p] === 'function' && //only the methods
+ // p !== 'constructor' && //not the constructor
+ // (i == 0 || p !== arr[i - 1]) && //not overriding in this prototype
+ // props.indexOf(p) === -1 //not overridden in a child
+ // );
+ // props = props.concat(
+ // l /* .map((p) => (obj[p] && obj[p][Symbol.toStringTag] === 'AsyncFunction' ? 'async ' : '' + p + '();')) */
+ // );
+ // } while (
+ // (obj = Object.getPrototypeOf(obj)) && //walk-up the prototype chain
+ // Object.getPrototypeOf(obj) //not the the Object prototype methods (hasOwnProperty, etc...)
+ // );
+
+ // return props.join('\n');
+ // }
}