mirror of
https://github.com/thaldrin/thaldrin.git
synced 2024-08-14 23:57:21 +00:00
typings for config
This commit is contained in:
parent
b11f63fc8b
commit
b12a772669
2 changed files with 40 additions and 2 deletions
17
sample.config.ts
Normal file
17
sample.config.ts
Normal 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: ""
|
||||||
|
}
|
||||||
|
}
|
|
@ -36,6 +36,7 @@ export type Command = {
|
||||||
|
|
||||||
export type Context = {
|
export type Context = {
|
||||||
client: Client;
|
client: Client;
|
||||||
|
args: string[]
|
||||||
guild: Guild | null;
|
guild: Guild | null;
|
||||||
message: Message;
|
message: Message;
|
||||||
channel: TextChannel | NewsChannel;
|
channel: TextChannel | NewsChannel;
|
||||||
|
@ -49,13 +50,29 @@ export type Context = {
|
||||||
|
|
||||||
// ! Config Typings
|
// ! Config Typings
|
||||||
|
|
||||||
interface Config {
|
export interface Config {
|
||||||
|
/**
|
||||||
|
* package.json import to autocompltete it's vars
|
||||||
|
*/
|
||||||
pkg: Pkg;
|
pkg: Pkg;
|
||||||
|
/**
|
||||||
|
* variables.ts import
|
||||||
|
* Public Variables are defined in here.
|
||||||
|
*/
|
||||||
variables: Variables;
|
variables: Variables;
|
||||||
|
/**
|
||||||
|
* API Keys for various APIs
|
||||||
|
*/
|
||||||
apis: Apis;
|
apis: Apis;
|
||||||
|
/**
|
||||||
|
* Discord API Token
|
||||||
|
*/
|
||||||
token: string;
|
token: string;
|
||||||
|
/**
|
||||||
|
* Config Strings for Supabase
|
||||||
|
* Thaldrin's Database
|
||||||
|
*/
|
||||||
supabase: Supabase;
|
supabase: Supabase;
|
||||||
developers: Developer[];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Developer {
|
interface Developer {
|
||||||
|
@ -75,6 +92,10 @@ interface Apis {
|
||||||
interface Variables {
|
interface Variables {
|
||||||
name: string;
|
name: string;
|
||||||
prefix: string[];
|
prefix: string[];
|
||||||
|
/**
|
||||||
|
* Developers of this Bot
|
||||||
|
*/
|
||||||
|
developers: Developer[];
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Pkg {
|
interface Pkg {
|
||||||
|
|
Loading…
Reference in a new issue