Fix variable name, sort imports
This commit is contained in:
parent
9cc8dfd61e
commit
8cb3956da5
@ -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 { IPCMessage } from '../../@types/Shared.js';
|
||||||
import { ClientOptions } from '../../@types/Client.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
|
class Client extends EventEmitter
|
||||||
{
|
{
|
||||||
|
@ -3,11 +3,10 @@ import path from 'node:path';
|
|||||||
import { LoggerClient } from '@navy.gif/logger';
|
import { LoggerClient } from '@navy.gif/logger';
|
||||||
|
|
||||||
import Client from '../Client.js';
|
import Client from '../Client.js';
|
||||||
import { ExtendedMap } from '../../utilities/ExtendedMap.js';
|
|
||||||
import Component from '../interfaces/Component.js';
|
import Component from '../interfaces/Component.js';
|
||||||
import Util from '../../utilities/Util.js';
|
|
||||||
import { isInitialisable } from '../interfaces/Initialisable.js';
|
import { isInitialisable } from '../interfaces/Initialisable.js';
|
||||||
|
import Util from '../../utilities/Util.js';
|
||||||
|
import { ExtendedMap } from '../../utilities/ExtendedMap.js';
|
||||||
|
|
||||||
class Registry
|
class Registry
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { ComponentOptions } from '../../../@types/Client.js';
|
|
||||||
import Client from '../Client.js';
|
import Client from '../Client.js';
|
||||||
|
|
||||||
|
import { ComponentOptions } from '../../../@types/Client.js';
|
||||||
|
|
||||||
export enum ComponentType
|
export enum ComponentType
|
||||||
{
|
{
|
||||||
EDIT_ME
|
EDIT_ME
|
||||||
|
@ -7,6 +7,7 @@ import { MasterLogger } from '@navy.gif/logger';
|
|||||||
import Shard from './Shard.js';
|
import Shard from './Shard.js';
|
||||||
import Util from '../utilities/Util.js';
|
import Util from '../utilities/Util.js';
|
||||||
import { ExtendedMap } from '../utilities/ExtendedMap.js';
|
import { ExtendedMap } from '../utilities/ExtendedMap.js';
|
||||||
|
|
||||||
import { ShardMethod } from '../../@types/Shard.js';
|
import { ShardMethod } from '../../@types/Shard.js';
|
||||||
import { ControllerOptions, ShardingOptions } from '../../@types/Controller.js';
|
import { ControllerOptions, ShardingOptions } from '../../@types/Controller.js';
|
||||||
|
|
||||||
@ -114,10 +115,10 @@ class Controller
|
|||||||
const ids = this.#shards.map(s => s.id);
|
const ids = this.#shards.map(s => s.id);
|
||||||
const id = ids.length ? Math.max(...ids) + 1 : 0;
|
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)
|
if (!file)
|
||||||
throw new Error('File seems to be missing');
|
throw new Error('File seems to be missing');
|
||||||
if (!discordOptions)
|
if (!clientOptions)
|
||||||
throw new Error('Missing discord options');
|
throw new Error('Missing discord options');
|
||||||
const shard = new Shard(this, id, {
|
const shard = new Shard(this, id, {
|
||||||
file,
|
file,
|
||||||
@ -125,7 +126,7 @@ class Controller
|
|||||||
args,
|
args,
|
||||||
execArgv,
|
execArgv,
|
||||||
totalShards,
|
totalShards,
|
||||||
clientOptions: discordOptions
|
clientOptions
|
||||||
});
|
});
|
||||||
this.#shards.set(shard.id, shard);
|
this.#shards.set(shard.id, shard);
|
||||||
this.#logger.attach(shard);
|
this.#logger.attach(shard);
|
||||||
|
Loading…
Reference in New Issue
Block a user