@@ -27,7 +27,7 @@ import {
27
27
} from "@spacebar/util" ;
28
28
import { WebSocket , Payload , OPCODES , Send } from "@spacebar/gateway" ;
29
29
import { check } from "./instanceOf" ;
30
- import { FindManyOptions , In , Like } from "typeorm" ;
30
+ import { FindManyOptions , ILike , In } from "typeorm" ;
31
31
32
32
export async function onRequestGuildMembers ( this : WebSocket , { d } : Payload ) {
33
33
// Schema validation can only accept either string or array, so transforming it here to support both
@@ -114,7 +114,7 @@ export async function onRequestGuildMembers(this: WebSocket, { d }: Payload) {
114
114
if ( query ) {
115
115
// @ts -expect-error memberFind.where is very much defined
116
116
memberFind . where . user = {
117
- username : Like ( query + "%" ) ,
117
+ username : ILike ( query + "%" ) ,
118
118
} ;
119
119
} else if ( user_ids && user_ids . length > 0 ) {
120
120
// @ts -expect-error memberFind.where is still very much defined
@@ -166,15 +166,17 @@ export async function onRequestGuildMembers(this: WebSocket, { d }: Payload) {
166
166
} ) ;
167
167
}
168
168
169
+ if ( chunks . length == 0 ) {
170
+ chunks . push ( {
171
+ ...baseData ,
172
+ members : [ ] ,
173
+ presences : presences ? [ ] : undefined ,
174
+ chunk_index : 0 ,
175
+ chunk_count : 1 ,
176
+ } ) ;
177
+ }
178
+
169
179
if ( notFound . length > 0 ) {
170
- if ( chunks . length == 0 )
171
- chunks . push ( {
172
- ...baseData ,
173
- members : [ ] ,
174
- presences : presences ? [ ] : undefined ,
175
- chunk_index : 0 ,
176
- chunk_count : 1 ,
177
- } ) ;
178
180
chunks [ 0 ] . not_found = notFound ;
179
181
}
180
182
0 commit comments