summary refs log tree commit diff
diff options
context:
space:
mode:
authorMathMan05 <mathmanrm@gmail.com>2026-02-04 09:20:24 -0600
committerRory& <root@rory.gay>2026-02-06 01:42:50 +0100
commitc92b93f0eeaaa502f18c67ea9d35313299d34b37 (patch)
tree89541258d64cf044c6d26b810e6982f8733130fa
parentMore nix stuff (diff)
downloadserver-ts-c92b93f0eeaaa502f18c67ea9d35313299d34b37.tar.xz
maybe fix bot threads?
-rw-r--r--src/gateway/opcodes/Identify.ts18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/gateway/opcodes/Identify.ts b/src/gateway/opcodes/Identify.ts

index dacc35cc..4c7c5ba3 100644 --- a/src/gateway/opcodes/Identify.ts +++ b/src/gateway/opcodes/Identify.ts
@@ -426,7 +426,7 @@ export async function onIdentify(this: WebSocket, data: Payload) { // Populated with guilds 'unavailable' currently // Just for bots - const pending_guilds: Guild[] = []; + const pending_guilds: object[] = []; // Generate guilds list ( make them unavailable if user is bot ) const guilds: GuildOrUnavailable[] = members.map((member) => { @@ -452,10 +452,6 @@ export async function onIdentify(this: WebSocket, data: Payload) { }) .sort((a, b) => a.position - b.position); - if (user.bot) { - pending_guilds.push(member.guild); - return { id: member.guild.id, unavailable: true }; - } const threads = threadMembers .filter(({ channel }) => channel.guild_id === member.guild.id) .map((_) => { @@ -467,13 +463,19 @@ export async function onIdentify(this: WebSocket, data: Payload) { ..._.channel.toJSON(), }; }); - - return { + const guildjson = { ...member.guild.toJSON(), joined_at: member.joined_at, threads, }; + + if (user.bot) { + pending_guilds.push(guildjson); + return { id: member.guild.id, unavailable: true }; + } + + return guildjson; }); const generateGuildsListTime = taskSw.getElapsedAndReset(); @@ -760,7 +762,7 @@ export async function onIdentify(this: WebSocket, data: Payload) { t: EVENTEnum.GuildCreate, s: this.sequence++, d: { - ...x.toJSON(), + ...x, members: botMemberObject ? [ {