xernerx 4.5.6 → 4.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build/XernerxContextCommand.d.ts +46 -46
- package/dist/build/XernerxContextCommand.d.ts.map +1 -1
- package/dist/build/XernerxContextCommand.js +63 -63
- package/dist/build/XernerxContextCommand.js.map +1 -1
- package/dist/build/XernerxEvent.d.ts +16 -15
- package/dist/build/XernerxEvent.d.ts.map +1 -1
- package/dist/build/XernerxEvent.js +20 -20
- package/dist/build/XernerxEvent.js.map +1 -1
- package/dist/build/XernerxInhibitor.d.ts +19 -19
- package/dist/build/XernerxInhibitor.d.ts.map +1 -1
- package/dist/build/XernerxInhibitor.js +12 -12
- package/dist/build/XernerxInhibitor.js.map +1 -1
- package/dist/build/XernerxMessageCommand.d.ts +44 -44
- package/dist/build/XernerxMessageCommand.d.ts.map +1 -1
- package/dist/build/XernerxMessageCommand.js +57 -57
- package/dist/build/XernerxMessageCommand.js.map +1 -1
- package/dist/build/XernerxSlashCommand.d.ts +56 -56
- package/dist/build/XernerxSlashCommand.d.ts.map +1 -1
- package/dist/build/XernerxSlashCommand.js +109 -109
- package/dist/build/XernerxSlashCommand.js.map +1 -1
- package/dist/client/XernerxClient.d.ts +45 -44
- package/dist/client/XernerxClient.d.ts.map +1 -1
- package/dist/client/XernerxClient.js +74 -73
- package/dist/client/XernerxClient.js.map +1 -1
- package/dist/client/XernerxShardClient.d.ts +11 -10
- package/dist/client/XernerxShardClient.d.ts.map +1 -1
- package/dist/client/XernerxShardClient.js +49 -48
- package/dist/client/XernerxShardClient.js.map +1 -1
- package/dist/functions/deploy.d.ts +1 -0
- package/dist/functions/deploy.d.ts.map +1 -1
- package/dist/functions/deploy.js +31 -30
- package/dist/functions/deploy.js.map +1 -1
- package/dist/functions/load.d.ts +1 -0
- package/dist/functions/load.d.ts.map +1 -1
- package/dist/functions/load.js +28 -27
- package/dist/functions/load.js.map +1 -1
- package/dist/functions/reload.d.ts +1 -0
- package/dist/functions/reload.d.ts.map +1 -1
- package/dist/functions/reload.js +35 -34
- package/dist/functions/reload.js.map +1 -1
- package/dist/functions/sendWebhook.d.ts +1 -0
- package/dist/functions/sendWebhook.d.ts.map +1 -1
- package/dist/functions/sendWebhook.js +11 -10
- package/dist/functions/sendWebhook.js.map +1 -1
- package/dist/functions/setPresence.d.ts +1 -0
- package/dist/functions/setPresence.d.ts.map +1 -1
- package/dist/functions/setPresence.js +18 -17
- package/dist/functions/setPresence.js.map +1 -1
- package/dist/functions/xernerxUser.d.ts +1 -0
- package/dist/functions/xernerxUser.d.ts.map +1 -1
- package/dist/functions/xernerxUser.js +6 -8
- package/dist/functions/xernerxUser.js.map +1 -1
- package/dist/handlers/CommandHandler.d.ts +9 -8
- package/dist/handlers/CommandHandler.d.ts.map +1 -1
- package/dist/handlers/CommandHandler.js +240 -239
- package/dist/handlers/CommandHandler.js.map +1 -1
- package/dist/handlers/EventHandler.d.ts +3 -2
- package/dist/handlers/EventHandler.d.ts.map +1 -1
- package/dist/handlers/EventHandler.js +19 -18
- package/dist/handlers/EventHandler.js.map +1 -1
- package/dist/handlers/ExtensionHandler.d.ts +3 -2
- package/dist/handlers/ExtensionHandler.d.ts.map +1 -1
- package/dist/handlers/ExtensionHandler.js +18 -17
- package/dist/handlers/ExtensionHandler.js.map +1 -1
- package/dist/handlers/Handler.d.ts +8 -7
- package/dist/handlers/Handler.d.ts.map +1 -1
- package/dist/handlers/Handler.js +32 -31
- package/dist/handlers/Handler.js.map +1 -1
- package/dist/handlers/InhibitorHandler.d.ts +3 -2
- package/dist/handlers/InhibitorHandler.d.ts.map +1 -1
- package/dist/handlers/InhibitorHandler.js +19 -18
- package/dist/handlers/InhibitorHandler.js.map +1 -1
- package/dist/handlers/WebhookHandler.d.ts +4 -3
- package/dist/handlers/WebhookHandler.d.ts.map +1 -1
- package/dist/handlers/WebhookHandler.js +47 -46
- package/dist/handlers/WebhookHandler.js.map +1 -1
- package/dist/main.d.ts +27 -26
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +27 -26
- package/dist/main.js.map +1 -1
- package/dist/models/Arguments.d.ts +3 -2
- package/dist/models/Arguments.d.ts.map +1 -1
- package/dist/models/Arguments.js +135 -134
- package/dist/models/Arguments.js.map +1 -1
- package/dist/tools/XernerxError.d.ts +5 -4
- package/dist/tools/XernerxError.d.ts.map +1 -1
- package/dist/tools/XernerxError.js +9 -8
- package/dist/tools/XernerxError.js.map +1 -1
- package/dist/tools/XernerxLog.d.ts +13 -12
- package/dist/tools/XernerxLog.d.ts.map +1 -1
- package/dist/tools/XernerxLog.js +76 -80
- package/dist/tools/XernerxLog.js.map +1 -1
- package/dist/types/extenders.d.ts +43 -12
- package/dist/types/extenders.d.ts.map +1 -1
- package/dist/types/extenders.js +1 -0
- package/dist/types/extenders.js.map +1 -1
- package/dist/types/interfaces.d.ts +186 -172
- package/dist/types/interfaces.d.ts.map +1 -1
- package/dist/types/interfaces.js +1 -0
- package/dist/types/interfaces.js.map +1 -1
- package/dist/types/types.d.ts +172 -171
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/types.js +1 -0
- package/dist/types/types.js.map +1 -1
- package/dist/utils/ClientUtil.d.ts +13 -6
- package/dist/utils/ClientUtil.d.ts.map +1 -1
- package/dist/utils/ClientUtil.js +56 -26
- package/dist/utils/ClientUtil.js.map +1 -1
- package/dist/utils/InteractionUtil.d.ts +10 -5
- package/dist/utils/InteractionUtil.d.ts.map +1 -1
- package/dist/utils/InteractionUtil.js +97 -8
- package/dist/utils/InteractionUtil.js.map +1 -1
- package/dist/utils/MessageUtil.d.ts +13 -9
- package/dist/utils/MessageUtil.d.ts.map +1 -1
- package/dist/utils/MessageUtil.js +130 -37
- package/dist/utils/MessageUtil.js.map +1 -1
- package/dist/utils/Util.d.ts +4 -3
- package/dist/utils/Util.d.ts.map +1 -1
- package/dist/utils/Util.js +8 -7
- package/dist/utils/Util.js.map +1 -1
- package/dist/validators/commandValidation.d.ts +3 -2
- package/dist/validators/commandValidation.d.ts.map +1 -1
- package/dist/validators/commandValidation.js +43 -42
- package/dist/validators/commandValidation.js.map +1 -1
- package/dist/validators/inhibitorValidations.d.ts +15 -14
- package/dist/validators/inhibitorValidations.d.ts.map +1 -1
- package/dist/validators/inhibitorValidations.js +31 -30
- package/dist/validators/inhibitorValidations.js.map +1 -1
- package/package.json +1 -1
package/dist/types/types.d.ts
CHANGED
|
@@ -1,186 +1,187 @@
|
|
|
1
|
+
/** @format */
|
|
1
2
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
SlashCommandBooleanOption,
|
|
4
|
+
SlashCommandChannelOption,
|
|
5
|
+
SlashCommandIntegerOption,
|
|
6
|
+
SlashCommandMentionableOption,
|
|
7
|
+
SlashCommandNumberOption,
|
|
8
|
+
SlashCommandRoleOption,
|
|
9
|
+
SlashCommandStringOption,
|
|
10
|
+
SlashCommandUserOption,
|
|
10
11
|
} from 'discord.js';
|
|
11
12
|
import { XernerxMessageContextInteraction, XernerxSlashInteraction, XernerxUserContextInteraction } from './extenders.js';
|
|
12
13
|
export type FileType = 'MessageCommand' | 'SlashCommand' | 'ContextCommand' | 'Event' | 'Inhibitor';
|
|
13
14
|
export type Locales =
|
|
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
|
-
|
|
15
|
+
| 'en-US'
|
|
16
|
+
| 'en-GB'
|
|
17
|
+
| 'bg'
|
|
18
|
+
| 'zh-CN'
|
|
19
|
+
| 'zh-TW'
|
|
20
|
+
| 'hr'
|
|
21
|
+
| 'cs'
|
|
22
|
+
| 'da'
|
|
23
|
+
| 'nl'
|
|
24
|
+
| 'fi'
|
|
25
|
+
| 'fr'
|
|
26
|
+
| 'de'
|
|
27
|
+
| 'el'
|
|
28
|
+
| 'hi'
|
|
29
|
+
| 'hu'
|
|
30
|
+
| 'it'
|
|
31
|
+
| 'ja'
|
|
32
|
+
| 'ko'
|
|
33
|
+
| 'lt'
|
|
34
|
+
| 'no'
|
|
35
|
+
| 'pl'
|
|
36
|
+
| 'pt-BR'
|
|
37
|
+
| 'ro'
|
|
38
|
+
| 'ru'
|
|
39
|
+
| 'es-ES'
|
|
40
|
+
| 'sv-SE'
|
|
41
|
+
| 'th'
|
|
42
|
+
| 'tr'
|
|
43
|
+
| 'uk'
|
|
44
|
+
| 'vi';
|
|
44
45
|
export type SlashCommandArgumentType = 'attachment' | 'boolean' | 'channel' | 'integer' | 'mentionable' | 'number' | 'role' | 'string' | 'user';
|
|
45
46
|
export type SlashCommandOptionChoices = SlashCommandStringOption | SlashCommandNumberOption | SlashCommandIntegerOption;
|
|
46
47
|
export type SlashCommandOption = SlashCommandOptionChoices | SlashCommandBooleanOption | SlashCommandUserOption | SlashCommandChannelOption | SlashCommandRoleOption | SlashCommandMentionableOption;
|
|
47
48
|
export type MessageCommandArgumentType =
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
49
|
+
| 'string'
|
|
50
|
+
| 'number'
|
|
51
|
+
| 'boolean'
|
|
52
|
+
| 'confirm'
|
|
53
|
+
| 'channel'
|
|
54
|
+
| 'guild'
|
|
55
|
+
| 'integer'
|
|
56
|
+
| 'mentionable'
|
|
57
|
+
| 'role'
|
|
58
|
+
| 'user'
|
|
59
|
+
| 'message'
|
|
60
|
+
| 'member'
|
|
61
|
+
| 'list'
|
|
62
|
+
| 'option'
|
|
63
|
+
| 'rest';
|
|
63
64
|
export type DiscordEventType =
|
|
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
|
-
|
|
65
|
+
| 'applicationCommandPermissionsUpdate'
|
|
66
|
+
| 'autoModerationActionExecution'
|
|
67
|
+
| 'autoModerationRuleCreate'
|
|
68
|
+
| 'autoModerationRuleDelete'
|
|
69
|
+
| 'autoModerationRuleUpdate'
|
|
70
|
+
| 'ready'
|
|
71
|
+
| 'guildCreate'
|
|
72
|
+
| 'guildDelete'
|
|
73
|
+
| 'guildUpdate'
|
|
74
|
+
| 'guildUnavailable'
|
|
75
|
+
| 'guildMemberAdd'
|
|
76
|
+
| 'guildMemberRemove'
|
|
77
|
+
| 'guildMemberUpdate'
|
|
78
|
+
| 'guildMemberAvailable'
|
|
79
|
+
| 'guildMembersChunk'
|
|
80
|
+
| 'guildIntegrationsUpdate'
|
|
81
|
+
| 'roleCreate'
|
|
82
|
+
| 'roleDelete'
|
|
83
|
+
| 'inviteCreate'
|
|
84
|
+
| 'inviteDelete'
|
|
85
|
+
| 'roleUpdate'
|
|
86
|
+
| 'emojiCreate'
|
|
87
|
+
| 'emojiDelete'
|
|
88
|
+
| 'emojiUpdate'
|
|
89
|
+
| 'guildBanAdd'
|
|
90
|
+
| 'guildBanRemove'
|
|
91
|
+
| 'channelCreate'
|
|
92
|
+
| 'channelDelete'
|
|
93
|
+
| 'channelUpdate'
|
|
94
|
+
| 'channelPinsUpdate'
|
|
95
|
+
| 'messageCreate'
|
|
96
|
+
| 'messageDelete'
|
|
97
|
+
| 'messageUpdate'
|
|
98
|
+
| 'messageDeleteBulk'
|
|
99
|
+
| 'messageReactionAdd'
|
|
100
|
+
| 'messageReactionRemove'
|
|
101
|
+
| 'messageReactionRemoveAll'
|
|
102
|
+
| 'messageReactionRemoveEmoji'
|
|
103
|
+
| 'threadCreate'
|
|
104
|
+
| 'threadDelete'
|
|
105
|
+
| 'threadUpdate'
|
|
106
|
+
| 'threadListSync'
|
|
107
|
+
| 'threadMemberUpdate'
|
|
108
|
+
| 'threadMembersUpdate'
|
|
109
|
+
| 'userUpdate'
|
|
110
|
+
| 'presenceUpdate'
|
|
111
|
+
| 'voiceServerUpdate'
|
|
112
|
+
| 'voiceStateUpdate'
|
|
113
|
+
| 'typingStart'
|
|
114
|
+
| 'webhookUpdate'
|
|
115
|
+
| 'interactionCreate'
|
|
116
|
+
| 'error'
|
|
117
|
+
| 'warn'
|
|
118
|
+
| 'debug'
|
|
119
|
+
| 'cacheSweep'
|
|
120
|
+
| 'shardDisconnect'
|
|
121
|
+
| 'shardError'
|
|
122
|
+
| 'shardReconnecting'
|
|
123
|
+
| 'shardReady'
|
|
124
|
+
| 'shardResume'
|
|
125
|
+
| 'invalidated'
|
|
126
|
+
| 'raw'
|
|
127
|
+
| 'stageInstanceCreate'
|
|
128
|
+
| 'stageInstanceUpdate'
|
|
129
|
+
| 'stageInstanceDelete'
|
|
130
|
+
| 'stickerCreate'
|
|
131
|
+
| 'stickerDelete'
|
|
132
|
+
| 'stickerUpdate'
|
|
133
|
+
| 'guildScheduledEventCreate'
|
|
134
|
+
| 'guildScheduledEventUpdate'
|
|
135
|
+
| 'guildScheduledEventDelete'
|
|
136
|
+
| 'guildScheduledEventUserAdd'
|
|
137
|
+
| 'guildScheduledEventUserRemove';
|
|
137
138
|
export type XernerxEventType = DiscordEventType | 'webhookCreate' | 'webhookError' | 'commandBlock' | 'commandError' | 'commandStart' | 'commandFinish' | 'commandCooldown';
|
|
138
139
|
export type XernerxInteraction<T extends XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction> = T extends XernerxSlashInteraction
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
140
|
+
? XernerxSlashInteraction
|
|
141
|
+
: T extends XernerxUserContextInteraction
|
|
142
|
+
? XernerxUserContextInteraction
|
|
143
|
+
: XernerxMessageContextInteraction;
|
|
143
144
|
export type PermissionNames =
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
145
|
+
| 'create instant invite'
|
|
146
|
+
| 'kick members'
|
|
147
|
+
| 'ban members'
|
|
148
|
+
| 'administrator'
|
|
149
|
+
| 'manage channels'
|
|
150
|
+
| 'manage guild'
|
|
151
|
+
| 'add reactions'
|
|
152
|
+
| 'view audit log'
|
|
153
|
+
| 'priority speaker'
|
|
154
|
+
| 'stream'
|
|
155
|
+
| 'view channel'
|
|
156
|
+
| 'send messages'
|
|
157
|
+
| 'send tts messages'
|
|
158
|
+
| 'manage messages'
|
|
159
|
+
| 'embed links'
|
|
160
|
+
| 'attach files'
|
|
161
|
+
| 'read message history'
|
|
162
|
+
| 'mention everyone'
|
|
163
|
+
| 'use external emojis'
|
|
164
|
+
| 'view guild insights'
|
|
165
|
+
| 'connect'
|
|
166
|
+
| 'speak'
|
|
167
|
+
| 'mute members'
|
|
168
|
+
| 'deafen members'
|
|
169
|
+
| 'move members'
|
|
170
|
+
| 'use vad'
|
|
171
|
+
| 'change nickname'
|
|
172
|
+
| 'manage nicknames'
|
|
173
|
+
| 'manage roles'
|
|
174
|
+
| 'manage webhooks'
|
|
175
|
+
| 'manage emojis and stickers'
|
|
176
|
+
| 'use application commands'
|
|
177
|
+
| 'request to speak'
|
|
178
|
+
| 'manage events'
|
|
179
|
+
| 'manage threads'
|
|
180
|
+
| 'create public threads'
|
|
181
|
+
| 'create private threads'
|
|
182
|
+
| 'use external stickers'
|
|
183
|
+
| 'send messages in threads'
|
|
184
|
+
| 'start embedded activities'
|
|
185
|
+
| 'moderate members';
|
|
185
186
|
export type InhibitorType = 'message' | 'interaction' | 'command' | 'channel' | 'user' | 'member' | 'guild' | 'contextCommand' | 'messageCommand' | 'slashCommand';
|
|
186
187
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,EACN,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,EACzB,6BAA6B,EAC7B,wBAAwB,EACxB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,gCAAgC,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAE1H,MAAM,MAAM,QAAQ,GAAG,gBAAgB,GAAG,cAAc,GAAG,gBAAgB,GAAG,OAAO,GAAG,WAAW,CAAC;AAEpG,MAAM,MAAM,OAAO,GAChB,OAAO,GACP,OAAO,GACP,IAAI,GACJ,OAAO,GACP,OAAO,GACP,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,OAAO,GACP,IAAI,GACJ,IAAI,GACJ,OAAO,GACP,OAAO,GACP,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,CAAC;AAER,MAAM,MAAM,wBAAwB,GAAG,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,aAAa,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEhJ,MAAM,MAAM,yBAAyB,GAAG,wBAAwB,GAAG,wBAAwB,GAAG,yBAAyB,CAAC;AAExH,MAAM,MAAM,kBAAkB,GAAG,yBAAyB,GAAG,yBAAyB,GAAG,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AAEnC,MAAM,MAAM,gBAAgB,GAAG,gBAAgB,GAAG,eAAe,GAAG,cAAc,GAAG,cAAc,GAAG,cAAc,GAAG,cAAc,GAAG,eAAe,GAAG,iBAAiB,CAAC;AAE5K,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,uBAAuB,GAAG,6BAA6B,GAAG,gCAAgC,IAAI,CAAC,SAAS,uBAAuB,GACrK,uBAAuB,GACvB,CAAC,SAAS,6BAA6B,GACvC,6BAA6B,GAC7B,gCAAgC,CAAC;AAEpC,MAAM,MAAM,eAAe,GACxB,uBAAuB,GACvB,cAAc,GACd,aAAa,GACb,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,eAAe,GACf,gBAAgB,GAChB,kBAAkB,GAClB,QAAQ,GACR,cAAc,GACd,eAAe,GACf,mBAAmB,GACnB,iBAAiB,GACjB,aAAa,GACb,cAAc,GACd,sBAAsB,GACtB,kBAAkB,GAClB,qBAAqB,GACrB,qBAAqB,GACrB,SAAS,GACT,OAAO,GACP,cAAc,GACd,gBAAgB,GAChB,cAAc,GACd,SAAS,GACT,iBAAiB,GACjB,kBAAkB,GAClB,cAAc,GACd,iBAAiB,GACjB,4BAA4B,GAC5B,0BAA0B,GAC1B,kBAAkB,GAClB,eAAe,GACf,gBAAgB,GAChB,uBAAuB,GACvB,wBAAwB,GACxB,uBAAuB,GACvB,0BAA0B,GAC1B,2BAA2B,GAC3B,kBAAkB,CAAC;AAEtB,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,cAAc,CAAC"}
|
package/dist/types/types.js
CHANGED
package/dist/types/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"","sourcesContent":["
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"AAAA,cAAc","sourcesContent":["/** @format */\n\nimport {\n\tSlashCommandBooleanOption,\n\tSlashCommandChannelOption,\n\tSlashCommandIntegerOption,\n\tSlashCommandMentionableOption,\n\tSlashCommandNumberOption,\n\tSlashCommandRoleOption,\n\tSlashCommandStringOption,\n\tSlashCommandUserOption,\n} from 'discord.js';\nimport { XernerxMessageContextInteraction, XernerxSlashInteraction, XernerxUserContextInteraction } from './extenders.js';\n\nexport type FileType = 'MessageCommand' | 'SlashCommand' | 'ContextCommand' | 'Event' | 'Inhibitor';\n\nexport type Locales =\n\t| 'en-US'\n\t| 'en-GB'\n\t| 'bg'\n\t| 'zh-CN'\n\t| 'zh-TW'\n\t| 'hr'\n\t| 'cs'\n\t| 'da'\n\t| 'nl'\n\t| 'fi'\n\t| 'fr'\n\t| 'de'\n\t| 'el'\n\t| 'hi'\n\t| 'hu'\n\t| 'it'\n\t| 'ja'\n\t| 'ko'\n\t| 'lt'\n\t| 'no'\n\t| 'pl'\n\t| 'pt-BR'\n\t| 'ro'\n\t| 'ru'\n\t| 'es-ES'\n\t| 'sv-SE'\n\t| 'th'\n\t| 'tr'\n\t| 'uk'\n\t| 'vi';\n\nexport type SlashCommandArgumentType = 'attachment' | 'boolean' | 'channel' | 'integer' | 'mentionable' | 'number' | 'role' | 'string' | 'user';\n\nexport type SlashCommandOptionChoices = SlashCommandStringOption | SlashCommandNumberOption | SlashCommandIntegerOption;\n\nexport type SlashCommandOption = SlashCommandOptionChoices | SlashCommandBooleanOption | SlashCommandUserOption | SlashCommandChannelOption | SlashCommandRoleOption | SlashCommandMentionableOption;\n\nexport type MessageCommandArgumentType =\n\t| 'string'\n\t| 'number'\n\t| 'boolean'\n\t| 'confirm'\n\t| 'channel'\n\t| 'guild'\n\t| 'integer'\n\t| 'mentionable'\n\t| 'role'\n\t| 'user'\n\t| 'message'\n\t| 'member'\n\t| 'list'\n\t| 'option'\n\t| 'rest';\n\nexport type DiscordEventType =\n\t| 'applicationCommandPermissionsUpdate'\n\t| 'autoModerationActionExecution'\n\t| 'autoModerationRuleCreate'\n\t| 'autoModerationRuleDelete'\n\t| 'autoModerationRuleUpdate'\n\t| 'ready'\n\t| 'guildCreate'\n\t| 'guildDelete'\n\t| 'guildUpdate'\n\t| 'guildUnavailable'\n\t| 'guildMemberAdd'\n\t| 'guildMemberRemove'\n\t| 'guildMemberUpdate'\n\t| 'guildMemberAvailable'\n\t| 'guildMembersChunk'\n\t| 'guildIntegrationsUpdate'\n\t| 'roleCreate'\n\t| 'roleDelete'\n\t| 'inviteCreate'\n\t| 'inviteDelete'\n\t| 'roleUpdate'\n\t| 'emojiCreate'\n\t| 'emojiDelete'\n\t| 'emojiUpdate'\n\t| 'guildBanAdd'\n\t| 'guildBanRemove'\n\t| 'channelCreate'\n\t| 'channelDelete'\n\t| 'channelUpdate'\n\t| 'channelPinsUpdate'\n\t| 'messageCreate'\n\t| 'messageDelete'\n\t| 'messageUpdate'\n\t| 'messageDeleteBulk'\n\t| 'messageReactionAdd'\n\t| 'messageReactionRemove'\n\t| 'messageReactionRemoveAll'\n\t| 'messageReactionRemoveEmoji'\n\t| 'threadCreate'\n\t| 'threadDelete'\n\t| 'threadUpdate'\n\t| 'threadListSync'\n\t| 'threadMemberUpdate'\n\t| 'threadMembersUpdate'\n\t| 'userUpdate'\n\t| 'presenceUpdate'\n\t| 'voiceServerUpdate'\n\t| 'voiceStateUpdate'\n\t| 'typingStart'\n\t| 'webhookUpdate'\n\t| 'interactionCreate'\n\t| 'error'\n\t| 'warn'\n\t| 'debug'\n\t| 'cacheSweep'\n\t| 'shardDisconnect'\n\t| 'shardError'\n\t| 'shardReconnecting'\n\t| 'shardReady'\n\t| 'shardResume'\n\t| 'invalidated'\n\t| 'raw'\n\t| 'stageInstanceCreate'\n\t| 'stageInstanceUpdate'\n\t| 'stageInstanceDelete'\n\t| 'stickerCreate'\n\t| 'stickerDelete'\n\t| 'stickerUpdate'\n\t| 'guildScheduledEventCreate'\n\t| 'guildScheduledEventUpdate'\n\t| 'guildScheduledEventDelete'\n\t| 'guildScheduledEventUserAdd'\n\t| 'guildScheduledEventUserRemove';\n\nexport type XernerxEventType = DiscordEventType | 'webhookCreate' | 'webhookError' | 'commandBlock' | 'commandError' | 'commandStart' | 'commandFinish' | 'commandCooldown';\n\nexport type XernerxInteraction<T extends XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction> = T extends XernerxSlashInteraction\n\t? XernerxSlashInteraction\n\t: T extends XernerxUserContextInteraction\n\t? XernerxUserContextInteraction\n\t: XernerxMessageContextInteraction;\n\nexport type PermissionNames =\n\t| 'create instant invite'\n\t| 'kick members'\n\t| 'ban members'\n\t| 'administrator'\n\t| 'manage channels'\n\t| 'manage guild'\n\t| 'add reactions'\n\t| 'view audit log'\n\t| 'priority speaker'\n\t| 'stream'\n\t| 'view channel'\n\t| 'send messages'\n\t| 'send tts messages'\n\t| 'manage messages'\n\t| 'embed links'\n\t| 'attach files'\n\t| 'read message history'\n\t| 'mention everyone'\n\t| 'use external emojis'\n\t| 'view guild insights'\n\t| 'connect'\n\t| 'speak'\n\t| 'mute members'\n\t| 'deafen members'\n\t| 'move members'\n\t| 'use vad'\n\t| 'change nickname'\n\t| 'manage nicknames'\n\t| 'manage roles'\n\t| 'manage webhooks'\n\t| 'manage emojis and stickers'\n\t| 'use application commands'\n\t| 'request to speak'\n\t| 'manage events'\n\t| 'manage threads'\n\t| 'create public threads'\n\t| 'create private threads'\n\t| 'use external stickers'\n\t| 'send messages in threads'\n\t| 'start embedded activities'\n\t| 'moderate members';\n\nexport type InhibitorType = 'message' | 'interaction' | 'command' | 'channel' | 'user' | 'member' | 'guild' | 'contextCommand' | 'messageCommand' | 'slashCommand';\n"]}
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
+
/** @format */
|
|
1
2
|
import XernerxClient from '../client/XernerxClient.js';
|
|
2
|
-
import { PresenceOptions } from '../types/interfaces.js';
|
|
3
|
+
import { PresenceOptions, ResolveCommandOptions } from '../types/interfaces.js';
|
|
3
4
|
import Util from './Util.js';
|
|
5
|
+
import { Collection } from 'discord.js';
|
|
6
|
+
import { XernerxContextCommand, XernerxMessageCommand, XernerxSlashCommand } from '../main.js';
|
|
4
7
|
export default class ClientUtil extends Util {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
hasVoted: Function;
|
|
9
|
+
constructor(client: XernerxClient);
|
|
10
|
+
setPresence(options: PresenceOptions): import('discord.js').ClientPresence | undefined;
|
|
11
|
+
resolveCommand(
|
|
12
|
+
options: ResolveCommandOptions
|
|
13
|
+
): XernerxMessageCommand | XernerxSlashCommand | XernerxContextCommand | Collection<string, XernerxMessageCommand | XernerxSlashCommand | XernerxContextCommand>;
|
|
14
|
+
resolveChannel(query: string | Record<string, string>): Promise<import('discord.js').Channel | null>;
|
|
15
|
+
resolveGuild(query: string | Record<string, string>): Promise<import('discord.js').Guild | null>;
|
|
16
|
+
uptime(timestamp?: number | null): string;
|
|
10
17
|
}
|
|
11
18
|
//# sourceMappingURL=ClientUtil.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientUtil.d.ts","sourceRoot":"","sources":["../../src/utils/ClientUtil.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ClientUtil.d.ts","sourceRoot":"","sources":["../../src/utils/ClientUtil.ts"],"names":[],"mappings":"AAAA,cAAc;AAGd,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAE/F,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,IAAI;IAC5B,QAAQ,EAAE,QAAQ,CAAC;gBAEtB,MAAM,EAAE,aAAa;IAI1B,WAAW,CAAC,OAAO,EAAE,eAAe;IAIpC,cAAc,CAAC,OAAO,EAAE,qBAAqB;IAiBvC,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAiBrD,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAczD,MAAM,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI;CAkBvC"}
|
package/dist/utils/ClientUtil.js
CHANGED
|
@@ -1,31 +1,61 @@
|
|
|
1
|
+
/** @format */
|
|
1
2
|
import setPresence from '../functions/setPresence.js';
|
|
2
3
|
import Util from './Util.js';
|
|
4
|
+
import { Collection } from 'discord.js';
|
|
3
5
|
export default class ClientUtil extends Util {
|
|
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
|
-
|
|
6
|
+
constructor(client) {
|
|
7
|
+
super(client);
|
|
8
|
+
}
|
|
9
|
+
setPresence(options) {
|
|
10
|
+
return setPresence(this.client, options);
|
|
11
|
+
}
|
|
12
|
+
resolveCommand(options) {
|
|
13
|
+
const commands = [],
|
|
14
|
+
collection = new Collection();
|
|
15
|
+
if (options?.type == 'MessageCommand' || !options?.type) commands.push(...this.client.commands.message);
|
|
16
|
+
if (options?.type == 'Interaction' || options?.type == 'SlashCommand' || !options?.type) commands.push(...this.client.commands.slash);
|
|
17
|
+
if (options?.type == 'Interaction' || options?.type == 'ContextCommand' || !options?.type) commands.push(...this.client.commands.context);
|
|
18
|
+
commands.map(([name, command]) => collection.set(name, command));
|
|
19
|
+
if (options?.name) {
|
|
20
|
+
return collection.get(options.name) || null;
|
|
21
|
+
} else return collection;
|
|
22
|
+
}
|
|
23
|
+
async resolveChannel(query) {
|
|
24
|
+
if (typeof query == 'object') query = query.id;
|
|
25
|
+
try {
|
|
26
|
+
let channel = this.client.channels.cache.find((channel) => (channel.name == query.toLowerCase() || channel.id == query.toLowerCase() ? channel : null)) || null;
|
|
27
|
+
if (!channel) channel = (await this.client.channels.fetch(query)) || null;
|
|
28
|
+
return channel;
|
|
29
|
+
} catch {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
async resolveGuild(query) {
|
|
34
|
+
if (typeof query == 'object') query = query.id;
|
|
35
|
+
try {
|
|
36
|
+
let guild = this.client.guilds.cache.find((guild) => guild.name.toLowerCase() == query.toLowerCase()) || null;
|
|
37
|
+
if (!guild) guild = (await this.client.guilds.fetch(query)) || null;
|
|
38
|
+
return guild;
|
|
39
|
+
} catch {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
uptime(timestamp) {
|
|
44
|
+
if (!timestamp) timestamp = this.client.uptime || 0;
|
|
45
|
+
let totalSeconds = timestamp / 1000;
|
|
46
|
+
let years = Math.floor(totalSeconds / 31536000);
|
|
47
|
+
totalSeconds %= 31536000;
|
|
48
|
+
let days = Math.floor(totalSeconds / 86400);
|
|
49
|
+
totalSeconds %= 86400;
|
|
50
|
+
let hours = Math.floor(totalSeconds / 3600);
|
|
51
|
+
totalSeconds %= 3600;
|
|
52
|
+
let minutes = Math.floor(totalSeconds / 60);
|
|
53
|
+
let seconds = Math.floor(totalSeconds % 60);
|
|
54
|
+
if (years >= 1) return `${years}y ${days}d ${hours}h ${minutes}m`;
|
|
55
|
+
else if (days >= 1) return `${days}d ${hours}h ${minutes}m`;
|
|
56
|
+
else if (hours >= 1) return `${hours}h ${minutes}m`;
|
|
57
|
+
else if (minutes >= 1) return `${minutes}m ${seconds}s`;
|
|
58
|
+
else return `${seconds}s`;
|
|
59
|
+
}
|
|
30
60
|
}
|
|
31
61
|
//# sourceMappingURL=ClientUtil.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientUtil.js","sourceRoot":"","sources":["../../src/utils/ClientUtil.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,6BAA6B,CAAC;AAGtD,OAAO,IAAI,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"ClientUtil.js","sourceRoot":"","sources":["../../src/utils/ClientUtil.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,WAAW,MAAM,6BAA6B,CAAC;AAGtD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGxC,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,IAAI;IAG3C,YAAY,MAAqB;QAChC,KAAK,CAAC,MAAM,CAAC,CAAC;IACf,CAAC;IAEM,WAAW,CAAC,OAAwB;QAC1C,OAAO,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1C,CAAC;IAEM,cAAc,CAAC,OAA8B;QACnD,MAAM,QAAQ,GAAG,EAAE,EAClB,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC;QAE/B,IAAI,OAAO,EAAE,IAAI,IAAI,gBAAgB,IAAI,CAAC,OAAO,EAAE,IAAI;YAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAExG,IAAI,OAAO,EAAE,IAAI,IAAI,aAAa,IAAI,OAAO,EAAE,IAAI,IAAI,cAAc,IAAI,CAAC,OAAO,EAAE,IAAI;YAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,CAA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AAI,KAAK,KAAK,KAAK,OAAO,GAAG,CAAC;aAC7D,IAAI,IAAI,IAAI,CAAC;YAAE,OAAO,GAAG,IAAI,KAAK,KAAK,KAAK,OAAO,GAAG,CAAC;aACvD,IAAI,KAAK,IAAI,CAAC;YAAE,OAAO,GAAG,KAAK,KAAK,OAAO,GAAG,CAAC;aAC/C,IAAI,OAAO,IAAI,CAAC;YAAE,OAAO,GAAG,OAAO,KAAK,OAAO,GAAG,CAAC;;YACnD,OAAO,GAAG,OAAO,GAAG,CAAC;IAC3B,CAAC;CACD","sourcesContent":["/** @format */\n\nimport setPresence from '../functions/setPresence.js';\nimport XernerxClient from '../client/XernerxClient.js';\nimport { PresenceOptions, ResolveCommandOptions } from '../types/interfaces.js';\nimport Util from './Util.js';\nimport { Collection } from 'discord.js';\nimport { XernerxContextCommand, XernerxMessageCommand, XernerxSlashCommand } from '../main.js';\n\nexport default class ClientUtil extends Util {\n\tpublic declare hasVoted: Function;\n\n\tconstructor(client: XernerxClient) {\n\t\tsuper(client);\n\t}\n\n\tpublic setPresence(options: PresenceOptions) {\n\t\treturn setPresence(this.client, options);\n\t}\n\n\tpublic resolveCommand(options: ResolveCommandOptions) {\n\t\tconst commands = [],\n\t\t\tcollection = new Collection();\n\n\t\tif (options?.type == 'MessageCommand' || !options?.type) commands.push(...this.client.commands.message);\n\n\t\tif (options?.type == 'Interaction' || options?.type == 'SlashCommand' || !options?.type) commands.push(...this.client.commands.slash);\n\n\t\tif (options?.type == 'Interaction' || options?.type == 'ContextCommand' || !options?.type) commands.push(...this.client.commands.context);\n\n\t\tcommands.map(([name, command]) => collection.set(name, command));\n\n\t\tif (options?.name) {\n\t\t\treturn (collection.get(options.name) as XernerxMessageCommand | XernerxSlashCommand | XernerxContextCommand) || null;\n\t\t} else return collection as Collection<string, XernerxMessageCommand | XernerxSlashCommand | XernerxContextCommand>;\n\t}\n\n\tpublic async resolveChannel(query: string | Record<string, string>) {\n\t\tif (typeof query == 'object') query = query.id;\n\n\t\ttry {\n\t\t\tlet channel =\n\t\t\t\tthis.client.channels.cache.find(<T>(channel: T) =>\n\t\t\t\t\t(channel as Record<string, string>).name == (query as string).toLowerCase() || (channel as Record<string, string>).id == (query as string).toLowerCase() ? channel : null\n\t\t\t\t) || null;\n\n\t\t\tif (!channel) channel = (await this.client.channels.fetch(query)) || null;\n\n\t\t\treturn channel;\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tpublic async resolveGuild(query: string | Record<string, string>) {\n\t\tif (typeof query == 'object') query = query.id;\n\n\t\ttry {\n\t\t\tlet guild = this.client.guilds.cache.find((guild) => guild.name.toLowerCase() == (query as string).toLowerCase()) || null;\n\n\t\t\tif (!guild) guild = (await this.client.guilds.fetch(query)) || null;\n\n\t\t\treturn guild;\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tpublic uptime(timestamp?: number | null) {\n\t\tif (!timestamp) timestamp = this.client.uptime || 0;\n\t\tlet totalSeconds = timestamp / 1000;\n\t\tlet years = Math.floor(totalSeconds / 31536000);\n\t\ttotalSeconds %= 31536000;\n\t\tlet days = Math.floor(totalSeconds / 86400);\n\t\ttotalSeconds %= 86400;\n\t\tlet hours = Math.floor(totalSeconds / 3600);\n\t\ttotalSeconds %= 3600;\n\t\tlet minutes = Math.floor(totalSeconds / 60);\n\t\tlet seconds = Math.floor(totalSeconds % 60);\n\n\t\tif (years >= 1) return `${years}y ${days}d ${hours}h ${minutes}m`;\n\t\telse if (days >= 1) return `${days}d ${hours}h ${minutes}m`;\n\t\telse if (hours >= 1) return `${hours}h ${minutes}m`;\n\t\telse if (minutes >= 1) return `${minutes}m ${seconds}s`;\n\t\telse return `${seconds}s`;\n\t}\n}\n"]}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
/** @format */
|
|
2
|
+
import { EmbedBuilder, InteractionEditReplyOptions, InteractionReplyOptions, MessagePayload } from 'discord.js';
|
|
2
3
|
import XernerxClient from '../client/XernerxClient.js';
|
|
4
|
+
import { PaginatorOptions } from '../types/interfaces.js';
|
|
3
5
|
import { XernerxInteraction } from '../types/types.js';
|
|
4
6
|
import Util from './Util.js';
|
|
5
|
-
import { XernerxMessageContextInteraction, XernerxSlashInteraction, XernerxUserContextInteraction } from '../
|
|
7
|
+
import { XernerxMessageContextInteraction, XernerxSlashInteraction, XernerxUserContextInteraction } from '../types/extenders.js';
|
|
6
8
|
export default class InteractionUtil extends Util {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
private interaction;
|
|
10
|
+
constructor(client: XernerxClient, interaction: XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>);
|
|
11
|
+
send(content: any): Promise<import('discord.js').Message<false> | import('discord.js').Message<true> | undefined>;
|
|
12
|
+
reply(content: string | MessagePayload | InteractionReplyOptions | InteractionEditReplyOptions): Promise<import('discord.js').InteractionResponse<boolean> | import('discord.js').Message<boolean>>;
|
|
13
|
+
commandName(): void;
|
|
14
|
+
paginator(embeds: Array<EmbedBuilder>, options?: PaginatorOptions): Promise<void | import('discord.js').Message<false> | import('discord.js').Message<true>>;
|
|
10
15
|
}
|
|
11
16
|
//# sourceMappingURL=InteractionUtil.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InteractionUtil.d.ts","sourceRoot":"","sources":["../../src/utils/InteractionUtil.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"InteractionUtil.d.ts","sourceRoot":"","sources":["../../src/utils/InteractionUtil.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,EAAgD,YAAY,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,cAAc,EAA2B,MAAM,YAAY,CAAC;AAEvL,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,gCAAgC,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAEjI,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,IAAI;IAChD,OAAO,CAAC,WAAW,CAAC;gBAER,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,kBAAkB,CAAC,uBAAuB,GAAG,6BAA6B,GAAG,gCAAgC,CAAC;IAMjJ,IAAI,CAAC,OAAO,EAAE,GAAG;IAMjB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,GAAG,uBAAuB,GAAG,2BAA2B;IAMpG,WAAW;IAEL,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,EAAE,OAAO,GAAE,gBAAqB;CA4FlF"}
|