From d078721dbb3689f4e9de7df3a98cd632c98bb838 Mon Sep 17 00:00:00 2001 From: Lio Young Date: Sat, 11 Sep 2021 13:38:36 +0200 Subject: [PATCH] edit utils --- src/utils/clean.ts | 2 +- src/utils/command.amount.ts | 4 ++-- src/utils/command.usage.ts | 29 +++++++++++++---------------- 3 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/utils/clean.ts b/src/utils/clean.ts index 81f5e82..a99282b 100644 --- a/src/utils/clean.ts +++ b/src/utils/clean.ts @@ -1,7 +1,7 @@ import config from '../../config' import replace from './replace' let SensitiveStrings = [ - config.token, + config.discord?.token, config.supabase.key, config.supabase.url, config.apis.sheri, diff --git a/src/utils/command.amount.ts b/src/utils/command.amount.ts index bc0ae36..86370d0 100644 --- a/src/utils/command.amount.ts +++ b/src/utils/command.amount.ts @@ -1,5 +1,5 @@ import path from "path" import { readdirSync as read } from "fs" -import Thaldrin from '../handler/client/Client' + export async function Folders() { return await read(path.join(__dirname, '../modules')) } -export async function Commands(module: string, Thaldrin: Thaldrin) { return Thaldrin.commands.filter(command => command.module === module) } \ No newline at end of file +export async function Commands(module: string, Thaldrin: any) { return Thaldrin.commands.filter((command: any) => command.module === module) } \ No newline at end of file diff --git a/src/utils/command.usage.ts b/src/utils/command.usage.ts index fa9646a..3e2be6d 100644 --- a/src/utils/command.usage.ts +++ b/src/utils/command.usage.ts @@ -1,19 +1,16 @@ -import supabase from "./database"; -import { Command, Usage } from "./types"; +// import supabase from "./database"; +// import { Command, Usage } from "./types"; +// import modulus from "./database" +// type C = { name: string; amount: number }; -type C = { name: string; amount: number }; +// export default async function usage(c: Map) { +// let commands: C[] = []; -export default async function usage(c: Map) { - let commands: C[] = []; +// let data = modulus. +// for(const command in data) { +// // @ts-ignore +// commands.push({ name: data[command].name, amount: data[command].amount }); +// } - let { data, error } = await supabase - .from("usage") - .select() - .filter("type", "eq", "command"); - for (const command in data) { - // @ts-ignore - commands.push({ name: data[command].name, amount: data[command].amount }); - } - - return commands.sort((a, b) => a.amount - b.amount); -} +// return commands.sort((a, b) => a.amount - b.amount); +// }