Skip to content

Commit

Permalink
fix(temp): only spin up 3 shards
Browse files Browse the repository at this point in the history
  • Loading branch information
Fyko committed Mar 15, 2024
1 parent a7a294c commit ecaef96
Show file tree
Hide file tree
Showing 3 changed files with 710 additions and 708 deletions.
7 changes: 4 additions & 3 deletions apps/bot/src/events/guildDelete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,20 @@ export default class implements Event {

public execute(): void {
this.client.on(this.event, async (guild) => {
logger.info({ guildId: guild.id }, `Left guild ${guild.name}`);
const name = guild.name ?? 'Unknown';
logger.info({ guildId: guild.id }, `Left guild ${name}`);
this.guildCount.dec();

void this.webhook.send({
embeds: [
new EmbedBuilder()
.setTitle(guild.name)
.setTitle(name)
.setThumbnail(guild.iconURL({ size: 512, forceStatic: false }) ?? null)
.setDescription(
stripIndents`
**ID**: \`${guild.id}\`
**Owner**: ${(await this.client.users.fetch(guild.ownerId)).tag} \`(${guild.ownerId})\`
**Members**: \`${guild.memberCount.toLocaleString('en-US')}\`
**Members**: \`${guild.memberCount?.toLocaleString('en-US') ?? 'Unknown'}\`
`,
)
.setTimestamp()
Expand Down
3 changes: 2 additions & 1 deletion apps/bot/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ const sql = postgres(process.env.DATABASE_URL, {
});

const client = createClient({
shards: 'auto',
// shards: 'auto',
shardCount: 3,
intents: [IntentsBitField.Flags.Guilds],
makeCache: Options.cacheWithLimits({
MessageManager: 5,
Expand Down
Loading

0 comments on commit ecaef96

Please sign in to comment.