mirror of https://github.com/thaldrin/thaldrin.git
edit utils
This commit is contained in:
parent
6145477a66
commit
d078721dbb
|
@ -1,7 +1,7 @@
|
||||||
import config from '../../config'
|
import config from '../../config'
|
||||||
import replace from './replace'
|
import replace from './replace'
|
||||||
let SensitiveStrings = [
|
let SensitiveStrings = [
|
||||||
config.token,
|
config.discord?.token,
|
||||||
config.supabase.key,
|
config.supabase.key,
|
||||||
config.supabase.url,
|
config.supabase.url,
|
||||||
config.apis.sheri,
|
config.apis.sheri,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import path from "path"
|
import path from "path"
|
||||||
import { readdirSync as read } from "fs"
|
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 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) }
|
|
@ -1,19 +1,16 @@
|
||||||
import supabase from "./database";
|
// import supabase from "./database";
|
||||||
import { Command, Usage } from "./types";
|
// 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 data = modulus.
|
||||||
let commands: C[] = [];
|
// for(const command in data) {
|
||||||
|
// // @ts-ignore
|
||||||
|
// commands.push({ name: data[command].name, amount: data[command].amount });
|
||||||
|
// }
|
||||||
|
|
||||||
let { data, error } = await supabase
|
// return commands.sort((a, b) => a.amount - b.amount);
|
||||||
.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);
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue