fix: more annotation for util functions

This commit is contained in:
Marius Begby committed 2023-08-27 01:54:46 +02:00
1 parent 1ae9503477
commit 39e818283d
5 files changed
+64 -27

No files matched your search

+9 -5
View File
@@ -1,14 +1,17 @@
import config from 'config';
import loggerModule from '../../services/logger';
const loadTestOptions = config.get('loadTestOptions');
import { LoadTestOptions } from '../../types/configTypes';
import { Client } from 'discord.js';
import { StartLoadTestParams } from '../../types/utilTypes';
const loadTestOptions: LoadTestOptions = config.get('loadTestOptions');
export const startLoadTest = async ({ client, executionId }) => {
export const startLoadTest = async ({ client, executionId }: StartLoadTestParams) => {
const logger = loggerModule.child({
source: 'startLoadTest.js',
module: 'utilOther',
name: 'startLoadTest',
executionId: executionId,
shardId: client.shard.ids[0]
shardId: client.shard?.ids[0]
});
if (!loadTestOptions.enabled) {
@@ -22,11 +25,12 @@ export const startLoadTest = async ({ client, executionId }) => {
logger.info(`Starting load test in ${channelIds.length} specified channels.`);
channelIds.forEach((each) => {
client.shard.broadcastEval(
async (shardClient, { channelId, track }) => {
client.shard?.broadcastEval(
async (shardClient: Client, { channelId, track }: { channelId: string; track: string }) => {
const channel = shardClient.channels.cache.get(channelId);
if (channel) {
/* eslint-disable no-undef */
// @ts-ignore
await player.play(channel.id, track, {
nodeOptions: {
leaveOnEmpty: false,