From 8cb3956da5279d365d1cf683c3545a441174ed45 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Tue, 9 Apr 2024 17:16:37 +0300 Subject: [PATCH] Fix variable name, sort imports --- src/client/Client.ts | 10 +++++----- src/client/components/Registry.ts | 5 ++--- src/client/interfaces/Component.ts | 3 ++- src/middleware/Controller.ts | 7 ++++--- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/client/Client.ts b/src/client/Client.ts index 1909d1f..01212f1 100644 --- a/src/client/Client.ts +++ b/src/client/Client.ts @@ -1,12 +1,12 @@ +import { EventEmitter } from 'node:events'; +import { LoggerClient, LoggerClientOptions } from '@navy.gif/logger'; +import Registry from './components/Registry.js'; +import Intercom from './components/Intercom.js'; +import Util from '../utilities/Util.js'; import { IPCMessage } from '../../@types/Shared.js'; import { ClientOptions } from '../../@types/Client.js'; -import Util from '../utilities/Util.js'; -import Intercom from './components/Intercom.js'; -import { LoggerClient, LoggerClientOptions } from '@navy.gif/logger'; -import Registry from './components/Registry.js'; -import { EventEmitter } from 'node:events'; class Client extends EventEmitter { diff --git a/src/client/components/Registry.ts b/src/client/components/Registry.ts index c2661fd..9437b0f 100644 --- a/src/client/components/Registry.ts +++ b/src/client/components/Registry.ts @@ -3,11 +3,10 @@ import path from 'node:path'; import { LoggerClient } from '@navy.gif/logger'; import Client from '../Client.js'; -import { ExtendedMap } from '../../utilities/ExtendedMap.js'; import Component from '../interfaces/Component.js'; -import Util from '../../utilities/Util.js'; import { isInitialisable } from '../interfaces/Initialisable.js'; - +import Util from '../../utilities/Util.js'; +import { ExtendedMap } from '../../utilities/ExtendedMap.js'; class Registry { diff --git a/src/client/interfaces/Component.ts b/src/client/interfaces/Component.ts index b19e233..2d58e5e 100644 --- a/src/client/interfaces/Component.ts +++ b/src/client/interfaces/Component.ts @@ -1,6 +1,7 @@ -import { ComponentOptions } from '../../../@types/Client.js'; import Client from '../Client.js'; +import { ComponentOptions } from '../../../@types/Client.js'; + export enum ComponentType { EDIT_ME diff --git a/src/middleware/Controller.ts b/src/middleware/Controller.ts index f0c1080..5812299 100644 --- a/src/middleware/Controller.ts +++ b/src/middleware/Controller.ts @@ -7,6 +7,7 @@ import { MasterLogger } from '@navy.gif/logger'; import Shard from './Shard.js'; import Util from '../utilities/Util.js'; import { ExtendedMap } from '../utilities/ExtendedMap.js'; + import { ShardMethod } from '../../@types/Shard.js'; import { ControllerOptions, ShardingOptions } from '../../@types/Controller.js'; @@ -114,10 +115,10 @@ class Controller const ids = this.#shards.map(s => s.id); const id = ids.length ? Math.max(...ids) + 1 : 0; - const { path: file, respawn, execArgv, scriptArgs: args, clientOptions: discordOptions } = this.#shardingOptions; + const { path: file, respawn, execArgv, scriptArgs: args, clientOptions } = this.#shardingOptions; if (!file) throw new Error('File seems to be missing'); - if (!discordOptions) + if (!clientOptions) throw new Error('Missing discord options'); const shard = new Shard(this, id, { file, @@ -125,7 +126,7 @@ class Controller args, execArgv, totalShards, - clientOptions: discordOptions + clientOptions }); this.#shards.set(shard.id, shard); this.#logger.attach(shard);