mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
refactor: resolve promises (#515)
* Adding missing await and updating some deps * Adding missing await and updating some deps * Adding missing await and updating some deps * Fix close code 4009 until deno fixes the issue: https://github.com/denoland/deno/pull/8776 * Fix heartbeating * Add await for the requestGuildMembers in requestAllMembers * Change body && body.file to body?.file * Fix lint #1 * Change body && body.file to body?.file * Fix lint * Deno lint * Update request.ts * Fix deno lint error * Update src/ws/shard_manager.ts Co-authored-by: ayntee <ayyantee@gmail.com> * Fix fetchMembers * Fix getMembersByQuery * Try to fix RequestMembersQueue processing * Deno lint * Fix requestGuildMembers * Fix requestGuildMembers * Fix requestAllMembers * Undo useless changes * Fix merge conflict * Fix merge conflict * Change for loop to Promise.all * Deno fmt Co-authored-by: ayntee <ayyantee@gmail.com> Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
This commit is contained in:
@@ -40,7 +40,7 @@ export async function spawnShards(
|
||||
data.shards > lastShardID ? data.shards : lastShardID,
|
||||
];
|
||||
// Start The shard
|
||||
await createShard(data, payload, false, shardID);
|
||||
createShard(data, payload, false, shardID);
|
||||
// Spawn next shard
|
||||
await spawnShards(
|
||||
data,
|
||||
@@ -90,7 +90,7 @@ export async function handleDiscordPayload(
|
||||
}
|
||||
}
|
||||
|
||||
export function requestAllMembers(
|
||||
export async function requestAllMembers(
|
||||
guild: Guild,
|
||||
resolve: (
|
||||
value: Collection<string, Member> | PromiseLike<Collection<string, Member>>,
|
||||
@@ -99,7 +99,13 @@ export function requestAllMembers(
|
||||
) {
|
||||
const nonce = `${guild.id}-${Date.now()}`;
|
||||
cache.fetchAllMembersProcessingRequests.set(nonce, resolve);
|
||||
return requestGuildMembers(guild.id, guild.shardID, nonce, options);
|
||||
|
||||
await requestGuildMembers(
|
||||
guild.id,
|
||||
guild.shardID,
|
||||
nonce,
|
||||
options,
|
||||
);
|
||||
}
|
||||
|
||||
export function sendGatewayCommand(
|
||||
|
||||
Reference in New Issue
Block a user