forked from Galactic/galactic-bot
allow shards to spawn one at a time
This commit is contained in:
parent
f87b9276ea
commit
9446a4dc89
2
@types/Moderation.d.ts
vendored
2
@types/Moderation.d.ts
vendored
@ -1,4 +1,4 @@
|
||||
import { GuildBasedChannel, Message } from 'discord.js';
|
||||
import { GuildBasedChannel, GuildTextBasedChannel, Message } from 'discord.js';
|
||||
import { GuildWrapper, InvokerWrapper, MemberWrapper, UserWrapper } from '../src/client/components/wrappers/index.ts';
|
||||
import { CommandOption, Infraction } from '../src/client/interfaces/index.ts';
|
||||
import { FormatParams, InfractionType } from './Client.ts';
|
||||
|
@ -182,7 +182,7 @@ class ModerationManager implements Initialisable
|
||||
const response = await this._handleTarget(Infraction, target, {
|
||||
invoker,
|
||||
guild: invoker.guild!,
|
||||
channel: invoker.channel,
|
||||
channel: invoker.channel as GuildTextBasedChannel,
|
||||
executor,
|
||||
arguments: args,
|
||||
points: args.points?.asNumber,
|
||||
|
@ -133,14 +133,15 @@ class Controller extends EventEmitter
|
||||
throw new TypeError('Amount of shards must be an integer.');
|
||||
}
|
||||
|
||||
const promises = [];
|
||||
// const promises = [];
|
||||
for (let i = 0; i < shardCount; i++)
|
||||
{
|
||||
const shard = this.createShard(shardCount);
|
||||
promises.push(shard.spawn());
|
||||
await shard.spawn(90_000);
|
||||
// promises.push();
|
||||
}
|
||||
|
||||
await Promise.all(promises);
|
||||
// await Promise.all(promises);
|
||||
|
||||
this.#logger.status(`Shards spawned, spawned ${this.#shards.size} shards. Took ${Date.now() - start} ms`);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user