typings for config

This commit is contained in:
Lio Young 2021-04-09 20:43:45 +02:00
parent b11f63fc8b
commit b12a772669
No known key found for this signature in database
GPG Key ID: 789795A11879E169
2 changed files with 40 additions and 2 deletions

17
sample.config.ts Normal file
View File

@ -0,0 +1,17 @@
import variables from "./variables"
import pkg from './package.json'
import { Config } from './src/utils/types'
export default <Config>{
pkg,
variables,
token: "",
apis: {
sheri: "",
yiffrest: ""
},
supabase: {
url: "",
key: ""
}
}

View File

@ -36,6 +36,7 @@ export type Command = {
export type Context = {
client: Client;
args: string[]
guild: Guild | null;
message: Message;
channel: TextChannel | NewsChannel;
@ -49,13 +50,29 @@ export type Context = {
// ! Config Typings
interface Config {
export interface Config {
/**
* package.json import to autocompltete it's vars
*/
pkg: Pkg;
/**
* variables.ts import
* Public Variables are defined in here.
*/
variables: Variables;
/**
* API Keys for various APIs
*/
apis: Apis;
/**
* Discord API Token
*/
token: string;
/**
* Config Strings for Supabase
* Thaldrin's Database
*/
supabase: Supabase;
developers: Developer[];
}
interface Developer {
@ -75,6 +92,10 @@ interface Apis {
interface Variables {
name: string;
prefix: string[];
/**
* Developers of this Bot
*/
developers: Developer[];
}
interface Pkg {