Ignore d.ts files in discord bot glob

This commit is contained in:
Hammad Jutt
2021-05-18 11:21:53 -06:00
committed by Alec LaLonde
parent f653d0879e
commit 51f82e6e2c
2 changed files with 8 additions and 7 deletions

View File

@@ -1,12 +1,12 @@
import { Discord } from '@typeit/discord';
import * as Path from 'path';
// Within a docker container: We are using tsc, so we want to load the compiled files.
// For local dev, we are transpiling: Load the .ts files.
const glob = process.env.RUNTIME_ENV === 'docker' ?
Path.join(__dirname, 'commands', '*.js') :
Path.join(__dirname, 'commands', '*.ts')
const glob =
process.env.RUNTIME_ENV === 'docker'
? Path.join(__dirname, 'commands', '*.js')
: Path.join(__dirname, 'commands', '!(*.d).ts');
@Discord('', {
import: [glob],

View File

@@ -5,9 +5,10 @@ import { CONFIG } from './config';
// Within a docker container: We are using tsc, so we want to load the compiled files.
// For local dev, we are transpiling: Load the .ts files.
const glob = process.env.RUNTIME_ENV === 'docker' ?
`${__dirname}/discord/**/*.js` :
`${__dirname}/discord/**/*.ts`
const glob =
process.env.RUNTIME_ENV === 'docker'
? `${__dirname}/discord/**/*.js`
: `${__dirname}/discord/**/!(*.d).ts`;
async function createDiscordClient(): Promise<Client> {
const client = new Client({