fix: more type annotation

This commit is contained in:
Marius Begby committed 2023-08-30 14:12:55 +02:00
1 parent 3ac692d8eb
commit 2560f0fe9a
65 files changed
+408 -343

No files matched your search

+6 -5
View File
@@ -1,6 +1,7 @@
import config from 'config';
import { Client } from 'discord.js';
import { Channel, Client } from 'discord.js';
import { Logger } from 'pino';
import loggerModule from '../../services/logger';
import { LoadTestOptions } from '../../types/configTypes';
import { StartLoadTestParams } from '../../types/utilTypes';
@@ -8,7 +9,7 @@ import { StartLoadTestParams } from '../../types/utilTypes';
const loadTestOptions: LoadTestOptions = config.get('loadTestOptions');
export const startLoadTest = async ({ client, executionId }: StartLoadTestParams) => {
const logger = loggerModule.child({
const logger: Logger = loggerModule.child({
source: 'startLoadTest.js',
module: 'utilOther',
name: 'startLoadTest',
@@ -21,15 +22,15 @@ export const startLoadTest = async ({ client, executionId }: StartLoadTestParams
return;
}
const channelIds = loadTestOptions.channelIdsToJoin;
const track = loadTestOptions.trackUrl;
const channelIds: string[] = loadTestOptions.channelIdsToJoin;
const track: string = loadTestOptions.trackUrl;
logger.info(`Starting load test in ${channelIds.length} specified channels.`);
channelIds.forEach((each) => {
client.shard?.broadcastEval(
async (shardClient: Client, { channelId, track }: { channelId: string; track: string }) => {
const channel = shardClient.channels.cache.get(channelId);
const channel: Channel | undefined = shardClient.channels.cache.get(channelId);
if (channel) {
/* eslint-disable no-undef */
// @ts-ignore