1
1
declare module '@iceprod/discord.js-commando' {
2
- import { Client , ClientEvents , ClientOptions , Collection , Guild , GuildResolvable , Message , MessageAttachment , MessageEditOptions , MessageEmbed , MessageOptions , MessageAdditions , MessageReaction , PermissionResolvable , PermissionString , StringResolvable , User , UserResolvable } from 'discord.js' ;
2
+ import { Client , ClientEvents , ClientOptions , Collection , Guild , GuildResolvable , Message , MessageAttachment , MessageEditOptions , MessageEmbed , MessageOptions , MessageAdditions , MessageReaction , PermissionResolvable , PermissionString , StringResolvable , User , UserResolvable , Interaction , AutocompleteInteraction } from 'discord.js' ;
3
3
4
4
export class Argument {
5
5
private constructor ( client : CommandoClient , info : ArgumentInfo ) ;
@@ -26,6 +26,7 @@ declare module '@iceprod/discord.js-commando' {
26
26
public obtain ( msg : CommandoMessage , val ?: string , promptLimit ?: number ) : Promise < ArgumentResult > ;
27
27
public parse ( val : string , msg : CommandoMessage ) : any | Promise < any > ;
28
28
public validate ( val : string , msg : CommandoMessage ) : boolean | string | Promise < boolean | string > ;
29
+ public autocomplete ?( interaction : Interaction , focus : AutocompleteInteraction [ "options" ] [ "data" ] [ 0 ] ) : Promise < AutocompleteRespond [ ] > ;
29
30
}
30
31
31
32
export abstract class Service {
@@ -100,6 +101,8 @@ declare module '@iceprod/discord.js-commando' {
100
101
public throttling : ThrottlingOptions ;
101
102
public unknown : boolean ;
102
103
public userPermissions : PermissionResolvable [ ] ;
104
+ public interactions ?: InteractionsInfo [ ] ;
105
+ public argsCollector ?: ArgumentCollector ;
103
106
104
107
public hasPermission ( message : CommandoMessage , ownerOverride ?: boolean ) : boolean | string ;
105
108
public isEnabledIn ( guild : GuildResolvable , bypassGroup ?: boolean ) : boolean ;
@@ -299,6 +302,11 @@ declare module '@iceprod/discord.js-commando' {
299
302
public registerServicesIn ( path : string ) : CommandoRegistry ;
300
303
public unregisterService ( service : Service ) : CommandoRegistry ;
301
304
public reregisterService ( service : Service , current : Service ) : CommandoRegistry ;
305
+
306
+ public _prepareCommandsForSlash ( ) : any [ ] ;
307
+ public registerSlashInGuild ( guild : GuildResolvable ) : Promise < void > ;
308
+ public registerSlashGlobally ( ) : Promise < void > ;
309
+ public resolveFromInteraction ( interaction : Interaction | Command | string ) : Command ;
302
310
}
303
311
304
312
export class FriendlyError extends Error {
@@ -391,6 +399,11 @@ declare module '@iceprod/discord.js-commando' {
391
399
answers : Message [ ] ;
392
400
}
393
401
402
+ export interface AutocompleteRespond {
403
+ name : string ;
404
+ value : string ;
405
+ }
406
+
394
407
export interface ArgumentInfo {
395
408
key : string ;
396
409
label ?: string ;
@@ -406,6 +419,7 @@ declare module '@iceprod/discord.js-commando' {
406
419
parse ?: Function ;
407
420
isEmpty ?: Function ;
408
421
wait ?: number ;
422
+ autocomplete ?( interaction : Interaction , focus : AutocompleteInteraction [ "options" ] [ "data" ] [ 0 ] ) : Promise < AutocompleteRespond [ ] > ;
409
423
}
410
424
411
425
export interface ArgumentResult {
@@ -416,6 +430,11 @@ declare module '@iceprod/discord.js-commando' {
416
430
}
417
431
418
432
type CommandGroupResolvable = CommandGroup | string ;
433
+ interface InteractionsInfo {
434
+ type : "user" | "message" | "slash" ,
435
+ name ?: string ,
436
+ description ?: string
437
+ }
419
438
420
439
export interface CommandInfo {
421
440
name : string ;
@@ -443,6 +462,7 @@ declare module '@iceprod/discord.js-commando' {
443
462
guarded ?: boolean ;
444
463
hidden ?: boolean ;
445
464
unknown ?: boolean ;
465
+ interactions ?: InteractionsInfo [ ] ;
446
466
}
447
467
448
468
export interface CommandoClientOptions extends ClientOptions {
0 commit comments