Remove changes of helpers, will change them on another pr

This commit is contained in:
TriForMine
2021-10-08 16:41:48 +02:00
parent 05804c9de4
commit 8c40679036
4 changed files with 13 additions and 12 deletions
+5 -5
View File
@@ -5,7 +5,7 @@ import { Errors } from "../../types/discordeno/errors.ts";
import { DiscordGatewayIntents } from "../../types/gateway/gateway_intents.ts";
import type { RequestGuildMembers } from "../../types/members/request_guild_members.ts";
import { Collection } from "../../util/collection.ts";
import {GatewayManager} from "../../bot.ts";
import { ws } from "../../ws/ws.ts";
/**
* ⚠️ BEGINNER DEVS!! YOU SHOULD ALMOST NEVER NEED THIS AND YOU CAN GET FROM cache.members.get()
@@ -15,10 +15,10 @@ import {GatewayManager} from "../../bot.ts";
* REST: 50/s global(across all shards) rate limit with ALL requests this included
* GW(this function): 120/m(PER shard) rate limit. Meaning if you have 8 shards your limit is now 960/m.
*/
export function fetchMembers(gateway: GatewayManager, guildId: bigint, shardId: number, options?: Omit<RequestGuildMembers, "guildId">) {
export function fetchMembers(guildId: bigint, shardId: number, options?: Omit<RequestGuildMembers, "guildId">) {
// You can request 1 member without the intent
// Check if intents is not 0 as proxy gateway won't set intents in other instances
if (gateway.identifyPayload.intents && (!options?.limit || options.limit > 1) && !(gateway.identifyPayload.intents & DiscordGatewayIntents.GuildMembers)) {
// Check if intents is not 0 as proxy ws won't set intents in other instances
if (ws.identifyPayload.intents && (!options?.limit || options.limit > 1) && !(ws.identifyPayload.intents & DiscordGatewayIntents.GuildMembers)) {
throw new Error(Errors.MISSING_INTENT_GUILD_MEMBERS);
}
@@ -30,7 +30,7 @@ export function fetchMembers(gateway: GatewayManager, guildId: bigint, shardId:
const nonce = `${guildId}-${Date.now()}`;
cache.fetchAllMembersProcessingRequests.set(nonce, resolve);
gateway.sendShardMessage(gateway, shardId, {
ws.sendShardMessage(shardId, {
op: DiscordGatewayOpcodes.RequestGuildMembers,
d: {
guild_id: guildId,