edit utils

This commit is contained in:
Lio Young 2021-09-11 13:38:36 +02:00
parent 6145477a66
commit d078721dbb
3 changed files with 16 additions and 19 deletions

View File

@ -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,

View File

@ -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) }
export async function Commands(module: string, Thaldrin: any) { return Thaldrin.commands.filter((command: any) => command.module === module) }

View File

@ -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<string, Command>) {
// let commands: C[] = [];
export default async function usage(c: Map<string, Command>) {
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>("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);
// }