mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-03 14:38:49 +00:00
fix: more annotation for util functions
This commit is contained in:
1 parent
1ae9503477
commit
39e818283d
5 files changed
+64
-27
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user