-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
typings.d.ts
147 lines (129 loc) · 3.32 KB
/
typings.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
import {
ApplicationCommandOption,
Client,
Guild,
GuildMember,
TextChannel,
User,
Message,
ChatInputCommandInteraction,
} from 'discord.js'
import CommandType from './src/util/CommandType'
import CooldownTypes from './src/util/CooldownTypes'
import Cooldowns from './src/util/Cooldowns'
import DefaultCommands from './src/util/DefaultCommands'
export default class NYX {
private _client!: Client
private _testServers!: string[]
private _botOwners!: string[]
private _cooldowns: Cooldowns | undefined
private _disabledDefaultCommands!: DefaultCommands[]
private _validations!: Validations
private _commandHandler: CommandHandler | undefined
private _eventHandler!: EventHandler
private _isConnectedToDB = false
private _defaultPrefix = '!'
constructor(options: Options)
public get client(): Client
public get testServers(): string[]
public get botOwners(): string[]
public get cooldowns(): Cooldowns
public get disabledDefaultCommands(): DefaultCommands[]
public get validations(): Validations
public get commandHandler(): CommandHandler
public get eventHandler(): EventHandler
public get isConnectedToDB(): boolean
public get defaultPrefix(): string
}
export interface Options {
client: Client
mongoUri?: string
commandsDir?: string
featuresDir?: string
testServers?: string[]
botOwners?: string[]
cooldownConfig?: CooldownConfig
disabledDefaultCommands?: DefaultCommands[]
events?: Events
validations?: Validations
defaultPrefix?: string
}
export interface CooldownConfig {
errorMessage: string
botOwnersBypass: boolean
dbRequired: number
}
export interface Events {
dir: string
[key: string]: any
}
export interface Validations {
runtime?: string
syntax?: string
}
export class Cooldowns {
constructor(instance: NYX, cooldownConfig: CooldownConfig) { }
}
export interface CooldownUsage {
errorMessage?: string
type: CooldownTypes
duration: string
}
export interface InternalCooldownConfig {
cooldownType: CooldownTypes
userId: string
actionId: string
guildId?: string
duration?: string
errorMessage?: string
}
export interface CommandUsage {
client: Client
instance: NYX
message?: Message | null
interaction?: ChatInputCommandInteraction | null
args: string[]
text: string
guild?: Guild | null
member?: GuildMember
user: User
channel?: TextChannel
cancelCooldown?: function
updateCooldown?: function
}
export interface CommandObject {
callback: (commandUsage: CommandUsage) => unknown
type: CommandType
init?: function
description?: string
aliases?: string[]
testOnly?: boolean
guildOnly?: boolean
ownerOnly?: boolean
permissions?: bigint[]
deferReply?: 'ephemeral' | boolean
cooldowns?: CooldownUsage
minArgs?: number
maxArgs?: number
correctSyntax?: string
expectedArgs?: string
options?: ApplicationCommandOption[]
autocomplete?: function
reply?: boolean
delete?: boolean
}
export type FileData = {
filePath: string
fileContents: any
}
export type AutocompleteChoice = {
name?: string,
value?: string,
}
export class Command {
constructor(instance: NYX, commandName: string, commandObject: CommandObject)
public get instance(): NYX
public get commandName(): string
public get commandObject(): CommandObject
}
export { CommandObject, Command, CommandType, CooldownTypes, DefaultCommands }