LazyRequest on mobile + socket not closed fixes
This commit is contained in:
@@ -137,12 +137,13 @@ export async function onIdentify(this: WebSocket, data: Payload) {
|
||||
guilds = guilds.map((guild) => {
|
||||
if (user.bot) {
|
||||
setTimeout(() => {
|
||||
Send(this, {
|
||||
var promise = Send(this, {
|
||||
op: OPCODES.Dispatch,
|
||||
t: EVENTEnum.GuildCreate,
|
||||
s: this.sequence++,
|
||||
d: guild,
|
||||
});
|
||||
if (promise) promise.catch(console.error);
|
||||
}, 500);
|
||||
return { id: guild.id, unavailable: true };
|
||||
}
|
||||
|
||||
@@ -39,13 +39,16 @@ async function getMembers(guild_id: string, range: [number, number]) {
|
||||
}
|
||||
catch (e) {
|
||||
console.error(`LazyRequest`, e);
|
||||
}
|
||||
|
||||
if (!members) {
|
||||
return {
|
||||
items: [],
|
||||
groups: [],
|
||||
range: [],
|
||||
members: [],
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const groups = [] as any[];
|
||||
const items = [];
|
||||
@@ -157,7 +160,7 @@ export async function onLazyRequest(this: WebSocket, { d }: Payload) {
|
||||
.flat()
|
||||
.unique();
|
||||
|
||||
return Send(this, {
|
||||
return await Send(this, {
|
||||
op: OPCODES.Dispatch,
|
||||
s: this.sequence++,
|
||||
t: "GUILD_MEMBER_LIST_UPDATE",
|
||||
|
||||
Reference in New Issue
Block a user