mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-17 00:10:58 -05:00
Add types for tokens and configs
This commit is contained in:
parent
83d78f71c0
commit
1aada89272
@ -2,16 +2,18 @@ import Discord, { Client, GatewayIntentBits, Partials } from 'discord.js';
|
||||
import fs from 'node:fs';
|
||||
import { Database } from './database';
|
||||
import timeNames from './timeNames';
|
||||
import { Punishment, formatTimeOpt, createTableOpt, punOpt } from './typings/interfaces';
|
||||
import { Punishment, formatTimeOpt, createTableOpt, punOpt, Tokens, Config } from './typings/interfaces';
|
||||
import MPDB from './models/MPServer';
|
||||
import axios from 'axios';
|
||||
import moment from 'moment';
|
||||
import tokens from './tokens.json';
|
||||
import config from './config.json';
|
||||
export class TClient extends Client {
|
||||
invites: Map<any, any>;
|
||||
commands: Discord.Collection<string, any>;
|
||||
registry: Array<Discord.ApplicationCommandDataResolvable>;
|
||||
config: any;
|
||||
tokens: any;
|
||||
config: Config;
|
||||
tokens: Tokens;
|
||||
YTCache: any;
|
||||
embed: typeof Discord.EmbedBuilder;
|
||||
collection: any;
|
||||
@ -44,8 +46,8 @@ export class TClient extends Client {
|
||||
this.invites = new Map();
|
||||
this.commands = new Discord.Collection();
|
||||
this.registry = [];
|
||||
this.config = require('./config.json');
|
||||
this.tokens = require('./tokens.json');
|
||||
this.config = config as Config;
|
||||
this.tokens = tokens as Tokens;
|
||||
this.YTCache = {
|
||||
'UCQ8k8yTDLITldfWYKDs3xFg': undefined, // Daggerwin
|
||||
'UCguI73--UraJpso4NizXNzA': undefined // Machinery Restorer
|
||||
|
60
src/typings/interfaces.d.ts
vendored
60
src/typings/interfaces.d.ts
vendored
@ -1,4 +1,4 @@
|
||||
import Discord from 'discord.js';
|
||||
import Discord, { ColorResolvable } from 'discord.js';
|
||||
|
||||
export interface UserLevels {
|
||||
messages: number,
|
||||
@ -122,4 +122,62 @@ interface slotUsage {
|
||||
}
|
||||
interface XMLText {
|
||||
_text: string
|
||||
}
|
||||
export interface Tokens {
|
||||
token_main: string
|
||||
token_beta: string
|
||||
token_toast: string
|
||||
token_tae: string
|
||||
}
|
||||
export interface Config {
|
||||
embedColor: ColorResolvable,
|
||||
embedColorGreen: ColorResolvable,
|
||||
embedColorYellow: ColorResolvable,
|
||||
embedColorRed: ColorResolvable,
|
||||
embedColorBCA: ColorResolvable,
|
||||
embedColorXmas: ColorResolvable,
|
||||
LRSstart: number,
|
||||
botSwitches: botSwitches,
|
||||
eval: Eval,
|
||||
mainServer: mainServer
|
||||
}
|
||||
interface botSwitches {
|
||||
registerCommands: boolean,
|
||||
commands: boolean,
|
||||
logs: boolean,
|
||||
automod: boolean,
|
||||
mpstats: boolean,
|
||||
autores: boolean
|
||||
}
|
||||
interface Eval {
|
||||
allowed: boolean,
|
||||
whitelist: Array<string>
|
||||
}
|
||||
interface mainServer {
|
||||
id: string,
|
||||
staffRoles: Array<string>,
|
||||
roles: mainServerRoles,
|
||||
channels: mainServerChannels
|
||||
}
|
||||
interface mainServerRoles {
|
||||
admin: string,
|
||||
bottech: string,
|
||||
dcmod: string,
|
||||
mpmanager: string,
|
||||
mpmod: string,
|
||||
vtcmanager: string,
|
||||
vtcstaff: string,
|
||||
ytmod: string,
|
||||
mphelper: string,
|
||||
mpplayer: string,
|
||||
vtcmember: string
|
||||
}
|
||||
interface mainServerChannels {
|
||||
console: string,
|
||||
errors: string,
|
||||
thismeanswar: string,
|
||||
bot_status: string,
|
||||
logs: string,
|
||||
welcome: string,
|
||||
botcommands: string
|
||||
}
|
Loading…
Reference in New Issue
Block a user