Merge pull request #1274 from dank074/patch/fix-requestGuildMembers-libraires
fix op 8 handler for some discord libraries
This commit is contained in:
commit
1d8e081fd8
@ -38,9 +38,16 @@ export async function onRequestGuildMembers(this: WebSocket, { d }: Payload) {
|
||||
|
||||
check.call(this, RequestGuildMembersSchema, d);
|
||||
|
||||
const { query, presences, nonce } = d as RequestGuildMembersSchema;
|
||||
const {
|
||||
presences,
|
||||
nonce,
|
||||
query: requestQuery,
|
||||
} = d as RequestGuildMembersSchema;
|
||||
let { limit, user_ids, guild_id } = d as RequestGuildMembersSchema;
|
||||
|
||||
// some discord libraries send empty string as query when they meant to send undefined, which was leading to errors being thrown in this handler
|
||||
const query = requestQuery != "" ? requestQuery : undefined;
|
||||
|
||||
guild_id = guild_id as string;
|
||||
user_ids = user_ids as string[] | undefined;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user