File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
packages/discord.js/typings Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -955,6 +955,8 @@ export class Client<Ready extends boolean = boolean> extends BaseClient {
955
955
private _eval ( script : string ) : unknown ;
956
956
private _validateOptions ( options : ClientOptions ) : void ;
957
957
private get _censoredToken ( ) : string | null ;
958
+ // This a technique used to brand the ready state. Or else we'll get `never` errors on typeguard checks.
959
+ private readonly _ready : Ready ;
958
960
959
961
public application : If < Ready , ClientApplication > ;
960
962
public channels : ChannelManager ;
Original file line number Diff line number Diff line change @@ -197,6 +197,12 @@ const client: Client = new Client({
197
197
} ) ,
198
198
} ) ;
199
199
200
+ if ( client . isReady ( ) ) {
201
+ expectType < Client < true > > ( client ) ;
202
+ } else {
203
+ expectType < Client > ( client ) ;
204
+ }
205
+
200
206
const testGuildId = '222078108977594368' ; // DJS
201
207
const testUserId = '987654321098765432' ; // example id
202
208
const globalCommandId = '123456789012345678' ; // example id
You can’t perform that action at this time.
0 commit comments