Typescript Continue

This commit is contained in:
Christer Warén
2023-06-04 06:20:37 +03:00
parent 3fc7337d0f
commit fb36a8f890
6 changed files with 13 additions and 14 deletions

View File

@ -14,7 +14,7 @@ export default class {
fs.mkdirSync(dir);
}
//console.log("");
const dataFiles = fs.readdirSync(path.join(path.dirname(__dirname), '../../datastore')).filter(f => f.endsWith('.json'));
const dataFiles = fs.readdirSync(path.join(path.dirname(__dirname), '../../datastore')).filter((f: string) => f.endsWith('.json'));
for (const file of dataFiles) {
try {
const json = require(`../../../datastore/${file}`);

View File

@ -47,7 +47,7 @@ export default class Radio extends Map {
if(!station) return;
const construct = {
const construct: any = {
textChannel: client.channels.cache.get(state.channels.text),
voiceChannel: client.channels.cache.get(state.channels.voice),
connection: null,

View File

@ -1,5 +1,6 @@
const _importDynamic = new Function('modulePath', 'return import(modulePath)');
const fetch = (...args: any) => _importDynamic('node-fetch').then(({default: fetch}) => fetch(...args));
// @ts-ignore
const fetch = (...args) => _importDynamic('node-fetch').then(({default: fetch}) => fetch(...args));
export default class Stations extends Array {
logger: any;