meocord 3.0.0 → 3.2.0
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/AUTHOR.md +2 -3
- package/README.md +361 -55
- package/dist/cjs/_shared/controller.decorator-MUHA_A3z.cjs +529 -0
- package/dist/cjs/core/index.cjs +246 -86
- package/dist/cjs/decorator/index.cjs +4 -2
- package/dist/cjs/enum/index.cjs +17 -4
- package/dist/cjs/testing/index.cjs +88 -4
- package/dist/esm/bin/app-template/README.md.template +61 -0
- package/dist/esm/bin/app-template/_env.example.template +2 -0
- package/dist/esm/bin/app-template/_gitignore.template +22 -0
- package/dist/esm/bin/app-template/_prettierrc.mjs.template +10 -0
- package/dist/esm/bin/app-template/eslint.config.ts.template +25 -0
- package/dist/esm/bin/app-template/meocord.config.ts.template +25 -0
- package/dist/esm/bin/app-template/package.json.template +38 -0
- package/dist/esm/bin/app-template/src/app.ts.template +44 -0
- package/dist/esm/bin/app-template/src/controllers/button/sample.button.controller.spec.ts.template +17 -0
- package/dist/esm/bin/app-template/src/controllers/button/sample.button.controller.ts.template +19 -0
- package/dist/esm/bin/app-template/src/controllers/context-menu/builders/sample.builder.ts.template +10 -0
- package/dist/esm/bin/app-template/src/controllers/context-menu/sample.context-menu.controller.spec.ts.template +17 -0
- package/dist/esm/bin/app-template/src/controllers/context-menu/sample.context-menu.controller.ts.template +13 -0
- package/dist/esm/bin/app-template/src/controllers/message/sample.message.controller.spec.ts.template +17 -0
- package/dist/esm/bin/app-template/src/controllers/message/sample.message.controller.ts.template +28 -0
- package/dist/esm/bin/app-template/src/controllers/modal-submit/sample.modal-submit.controller.spec.ts.template +17 -0
- package/dist/esm/bin/app-template/src/controllers/modal-submit/sample.modal-submit.controller.ts.template +13 -0
- package/dist/esm/bin/app-template/src/controllers/reaction/sample.reaction.controller.spec.ts.template +17 -0
- package/dist/esm/bin/app-template/src/controllers/reaction/sample.reaction.controller.ts.template +29 -0
- package/dist/esm/bin/app-template/src/controllers/select-menu/sample.select-menu.controller.spec.ts.template +17 -0
- package/dist/esm/bin/app-template/src/controllers/select-menu/sample.select-menu.controller.ts.template +11 -0
- package/dist/esm/bin/app-template/src/controllers/slash/builders/sample.builder.ts.template +10 -0
- package/dist/esm/bin/app-template/src/controllers/slash/sample.slash.controller.spec.ts.template +17 -0
- package/dist/esm/bin/app-template/src/controllers/slash/sample.slash.controller.ts.template +19 -0
- package/dist/esm/bin/app-template/src/guards/rate-limit.guard.spec.ts.template +13 -0
- package/dist/esm/bin/app-template/src/guards/rate-limit.guard.ts.template +52 -0
- package/dist/esm/bin/app-template/src/main.ts.template +14 -0
- package/dist/esm/bin/app-template/src/services/sample.service.spec.ts.template +17 -0
- package/dist/esm/bin/app-template/src/services/sample.service.ts.template +9 -0
- package/dist/esm/bin/app-template/tsconfig.eslint.json.template +5 -0
- package/dist/esm/bin/app-template/tsconfig.json.template +30 -0
- package/dist/esm/bin/app-template/tsconfig.test.json.template +8 -0
- package/dist/esm/bin/app-template/vitest.config.ts.template +35 -0
- package/dist/esm/bin/builder-template/builder/primary-entry-point.builder.template +26 -0
- package/dist/esm/bin/builder-template/controller/autocomplete.controller.template +16 -0
- package/dist/esm/bin/builder-template/controller/button.controller.template +1 -1
- package/dist/esm/bin/builder-template/controller/channel-select-menu.controller.template +12 -0
- package/dist/esm/bin/builder-template/controller/context-menu.controller.template +2 -2
- package/dist/esm/bin/builder-template/controller/mentionable-select-menu.controller.template +12 -0
- package/dist/esm/bin/builder-template/controller/modal-submit.controller.template +1 -1
- package/dist/esm/bin/builder-template/controller/primary-entry-point.controller.template +12 -0
- package/dist/esm/bin/builder-template/controller/role-select-menu.controller.template +12 -0
- package/dist/esm/bin/builder-template/controller/slash.controller.template +1 -1
- package/dist/esm/bin/builder-template/controller/user-select-menu.controller.template +12 -0
- package/dist/esm/bin/generator.js +4 -9
- package/dist/esm/bin/helper/app-generator.helper.js +78 -0
- package/dist/esm/bin/helper/controller-generator.helper.js +24 -7
- package/dist/esm/bin/meocord.js +156 -75
- package/dist/esm/core/meocord.app.js +247 -86
- package/dist/esm/decorator/controller.decorator.js +73 -10
- package/dist/esm/decorator/guard.decorator.js +1 -1
- package/dist/esm/decorator/index.js +1 -1
- package/dist/esm/enum/controller.enum.js +23 -4
- package/dist/esm/testing/mock-interaction.js +89 -5
- package/dist/esm/util/common.util.js +11 -3
- package/dist/esm/util/generator-cli.util.js +21 -4
- package/dist/esm/util/interaction.util.js +174 -0
- package/dist/esm/util/package-manager.util.js +9 -2
- package/dist/esm/util/package-version.util.js +32 -0
- package/dist/esm/util/runtime.util.js +72 -0
- package/dist/types/controller.enum-DYfhYaat.d.ts +36 -0
- package/dist/types/core/index.d.ts +75 -2
- package/dist/types/decorator/index.d.ts +61 -49
- package/dist/types/enum/index.d.ts +1 -1
- package/dist/types/interface/index.d.ts +89 -3
- package/dist/types/testing/index.d.ts +3 -21
- package/package.json +11 -12
- package/dist/cjs/_shared/controller.decorator-CC6BjHkS.cjs +0 -288
- package/dist/types/controller.enum-QA-IuReF.d.ts +0 -18
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
require('reflect-metadata');
|
|
4
|
-
var inversify = require('inversify');
|
|
5
|
-
var discord_js = require('discord.js');
|
|
6
|
-
var enum_index = require('../enum/index.cjs');
|
|
7
|
-
var metadataKey_enum = require('./metadata-key.enum-BzzvGUId.cjs');
|
|
8
|
-
|
|
9
|
-
const COMMAND_METADATA_KEY = Symbol('commands');
|
|
10
|
-
const MESSAGE_HANDLER_METADATA_KEY = Symbol('message_handlers');
|
|
11
|
-
const REACTION_HANDLER_METADATA_KEY = Symbol('reaction_handlers');
|
|
12
|
-
/**
|
|
13
|
-
* Decorator to register message handlers in the controller.
|
|
14
|
-
*
|
|
15
|
-
* @param keyword - An optional keyword to filter messages this handler should respond to.
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```typescript
|
|
19
|
-
* @MessageHandler('hello')
|
|
20
|
-
* async handleHelloMessage(message: Message) {
|
|
21
|
-
* await message.reply('Hello! How can I help you?');
|
|
22
|
-
* }
|
|
23
|
-
*
|
|
24
|
-
* @MessageHandler()
|
|
25
|
-
* async handleAnyMessage(message: Message) {
|
|
26
|
-
* console.log(`Received a message: ${message.content}`);
|
|
27
|
-
* }
|
|
28
|
-
* ```
|
|
29
|
-
*/ function MessageHandler(keyword) {
|
|
30
|
-
return function(target, propertyKey, _descriptor) {
|
|
31
|
-
const handlers = Reflect.getMetadata(MESSAGE_HANDLER_METADATA_KEY, target) || [];
|
|
32
|
-
handlers.push({
|
|
33
|
-
keyword,
|
|
34
|
-
method: propertyKey.toString()
|
|
35
|
-
});
|
|
36
|
-
Reflect.defineMetadata(MESSAGE_HANDLER_METADATA_KEY, handlers, target);
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Decorator to register reaction handlers in the controller.
|
|
41
|
-
*
|
|
42
|
-
* @param emoji - Optional emoji name to filter reactions this handler should respond to.
|
|
43
|
-
*
|
|
44
|
-
* @example
|
|
45
|
-
* ```typescript
|
|
46
|
-
* @ReactionHandler('👍')
|
|
47
|
-
* async handleThumbsUpReaction(reaction: MessageReaction, { user }: ReactionHandlerOptions) {
|
|
48
|
-
* console.log(`User ${user.username} reacted with 👍`);
|
|
49
|
-
* }
|
|
50
|
-
*
|
|
51
|
-
* @ReactionHandler()
|
|
52
|
-
* async handleAnyReaction(reaction: MessageReaction, { user }: ReactionHandlerOptions) {
|
|
53
|
-
* console.log(`User ${user.username} reacted with ${reaction.emoji.name}`);
|
|
54
|
-
* }
|
|
55
|
-
* ```
|
|
56
|
-
*/ function ReactionHandler(emoji) {
|
|
57
|
-
return function(target, propertyKey, _descriptor) {
|
|
58
|
-
const handlers = Reflect.getMetadata(REACTION_HANDLER_METADATA_KEY, target) || [];
|
|
59
|
-
handlers.push({
|
|
60
|
-
emoji,
|
|
61
|
-
method: propertyKey.toString()
|
|
62
|
-
});
|
|
63
|
-
Reflect.defineMetadata(REACTION_HANDLER_METADATA_KEY, handlers, target);
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Retrieves reaction handlers metadata from a given controller.
|
|
68
|
-
*
|
|
69
|
-
* @param controller - The controller class instance.
|
|
70
|
-
* @returns An array of reaction handler metadata objects.
|
|
71
|
-
*/ function getReactionHandlers(controller) {
|
|
72
|
-
return Reflect.getMetadata(REACTION_HANDLER_METADATA_KEY, controller) || [];
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Retrieves message handlers metadata from a given controller.
|
|
76
|
-
*
|
|
77
|
-
* @param controller - The controller class instance.
|
|
78
|
-
* @returns An array of message handler method names.
|
|
79
|
-
*/ function getMessageHandlers(controller) {
|
|
80
|
-
return Reflect.getMetadata(MESSAGE_HANDLER_METADATA_KEY, controller) || [];
|
|
81
|
-
}
|
|
82
|
-
const PLACEHOLDER_PATTERN = /\{(\w+)}/g;
|
|
83
|
-
/** The character a parameter will not cross, so one pattern segment maps to one value. */ const PARAM_SEPARATOR = '/';
|
|
84
|
-
/** Escapes a literal stretch of a pattern so only placeholders stay meaningful. */ const escapeLiteral = (literal)=>literal.replace(/[/\\^$*+?.()|[\]{}]/g, '\\$&');
|
|
85
|
-
/**
|
|
86
|
-
* Helper function to create regex and parameter mappings from a pattern string.
|
|
87
|
-
*
|
|
88
|
-
* A `{name}` matches anything up to the next `/`, the same rule Express and Rails use
|
|
89
|
-
* for a path segment. That is what lets a value the application does not control — a
|
|
90
|
-
* uuid, an opaque vendor id, a slug — be captured whole without the author annotating
|
|
91
|
-
* anything, since a hyphen inside it is data rather than structure.
|
|
92
|
-
*
|
|
93
|
-
* It also keeps neighbouring patterns apart: `profile/{uuid}` and `profile/{uuid}/{id}`
|
|
94
|
-
* cannot both match one id, because a parameter cannot swallow the separator between
|
|
95
|
-
* them. Patterns separated by `-` instead have no such boundary, so a pair like
|
|
96
|
-
* `profile-{uuid}` and `profile-{uuid}-{id}` is ambiguous — {@link findAmbiguousRoutes}
|
|
97
|
-
* reports those at registration.
|
|
98
|
-
*
|
|
99
|
-
* @param pattern - The pattern string to parse.
|
|
100
|
-
* @returns The regex, the parameter names, and how specific the pattern is.
|
|
101
|
-
*/ function createRegexFromPattern(pattern) {
|
|
102
|
-
const params = [];
|
|
103
|
-
let regexPattern = '';
|
|
104
|
-
let cursor = 0;
|
|
105
|
-
let literalLength = 0;
|
|
106
|
-
PLACEHOLDER_PATTERN.lastIndex = 0;
|
|
107
|
-
let match;
|
|
108
|
-
while((match = PLACEHOLDER_PATTERN.exec(pattern)) !== null){
|
|
109
|
-
const [placeholder, param] = match;
|
|
110
|
-
const literal = pattern.slice(cursor, match.index);
|
|
111
|
-
const after = pattern[match.index + placeholder.length];
|
|
112
|
-
// A parameter has to own its segment. Sharing one with a literal leaves no
|
|
113
|
-
// boundary a sibling pattern can be told apart by, and the resulting overlap has
|
|
114
|
-
// no correct reading -- `profile-{uuid}` and `profile-{uuid}-{id}` both take
|
|
115
|
-
// `profile-a-b`. Registration is the last point where that is still fixable.
|
|
116
|
-
if (literal !== '' && !literal.endsWith(PARAM_SEPARATOR) || after !== undefined && after !== PARAM_SEPARATOR) {
|
|
117
|
-
throw new Error(`Invalid pattern "${pattern}": {${param}} must occupy a whole segment, so it has to be ` + `preceded and followed by "${PARAM_SEPARATOR}" or by the ends of the pattern. ` + `Write "a${PARAM_SEPARATOR}{${param}}" rather than "a-{${param}}".`);
|
|
118
|
-
}
|
|
119
|
-
literalLength += literal.length;
|
|
120
|
-
regexPattern += escapeLiteral(literal);
|
|
121
|
-
regexPattern += `(?<${param}>[^${PARAM_SEPARATOR}]+)`;
|
|
122
|
-
params.push(param);
|
|
123
|
-
cursor = match.index + placeholder.length;
|
|
124
|
-
}
|
|
125
|
-
const trailing = pattern.slice(cursor);
|
|
126
|
-
literalLength += trailing.length;
|
|
127
|
-
regexPattern += escapeLiteral(trailing);
|
|
128
|
-
const regex = new RegExp(`^${regexPattern}$`);
|
|
129
|
-
// Literal text is the signal: a pattern spelling out more of the id describes it
|
|
130
|
-
// more exactly than one leaving it to a parameter. Fewer parameters breaks a tie
|
|
131
|
-
// between equal-length patterns, so the ranking is total and never falls back to
|
|
132
|
-
// declaration order.
|
|
133
|
-
const specificity = literalLength * 1000 - params.length;
|
|
134
|
-
return {
|
|
135
|
-
regex,
|
|
136
|
-
params,
|
|
137
|
-
specificity
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* Decorator to register command methods in a controller.
|
|
142
|
-
*
|
|
143
|
-
* @param commandName - The name or pattern of the command.
|
|
144
|
-
* @param builderOrType - A command builder class or a command type from `CommandType`.
|
|
145
|
-
*
|
|
146
|
-
* @example
|
|
147
|
-
* ```typescript
|
|
148
|
-
* @Command('help', CommandType.SLASH)
|
|
149
|
-
* public async handleHelp(interaction: ChatInputCommandInteraction) {
|
|
150
|
-
* await interaction.reply('This is the help command!')
|
|
151
|
-
* }
|
|
152
|
-
*
|
|
153
|
-
* @Command('stats-{id}', CommandType.BUTTON)
|
|
154
|
-
* public async handleStats(message: ButtonInteraction, { id }) {
|
|
155
|
-
* await message.reply(`Fetching stats for ID: ${id}`);
|
|
156
|
-
* }
|
|
157
|
-
* ```
|
|
158
|
-
*/ function Command(commandName, builderOrType) {
|
|
159
|
-
return function(target, propertyKey, _descriptor) {
|
|
160
|
-
const originalMethod = _descriptor.value;
|
|
161
|
-
if (!originalMethod) {
|
|
162
|
-
throw new Error(`Missing implementation for method ${propertyKey}`);
|
|
163
|
-
}
|
|
164
|
-
// Wrap original method for interaction type validation
|
|
165
|
-
_descriptor.value = function(interaction, params) {
|
|
166
|
-
const expectedInteraction = commandType === enum_index.CommandType.BUTTON && interaction instanceof discord_js.ButtonInteraction || commandType === enum_index.CommandType.SELECT_MENU && interaction instanceof discord_js.StringSelectMenuInteraction || commandType === enum_index.CommandType.SLASH && interaction instanceof discord_js.ChatInputCommandInteraction || commandType === enum_index.CommandType.CONTEXT_MENU && interaction instanceof discord_js.ContextMenuCommandInteraction || commandType === enum_index.CommandType.MODAL_SUBMIT && interaction instanceof discord_js.ModalSubmitInteraction;
|
|
167
|
-
if (!expectedInteraction) {
|
|
168
|
-
throw new Error(`Invalid interaction type passed to @Command for method: ${propertyKey}`);
|
|
169
|
-
}
|
|
170
|
-
return originalMethod.apply(this, [
|
|
171
|
-
interaction,
|
|
172
|
-
params
|
|
173
|
-
]);
|
|
174
|
-
};
|
|
175
|
-
// Retrieve existing metadata or initialize it
|
|
176
|
-
const commands = Reflect.getMetadata(COMMAND_METADATA_KEY, target) || {};
|
|
177
|
-
let builderInstance;
|
|
178
|
-
let commandType;
|
|
179
|
-
let regex;
|
|
180
|
-
let dynamicParams = [];
|
|
181
|
-
let specificity;
|
|
182
|
-
// Determine command type and builder
|
|
183
|
-
if (typeof builderOrType === 'function') {
|
|
184
|
-
const builderObj = new builderOrType();
|
|
185
|
-
builderInstance = builderObj.build(commandName);
|
|
186
|
-
commandType = Reflect.getMetadata(metadataKey_enum.MetadataKey.CommandType, builderOrType);
|
|
187
|
-
if (!(commandType in enum_index.CommandType)) {
|
|
188
|
-
throw new Error(`Metadata for 'commandType' is missing on builder ${builderOrType.name}`);
|
|
189
|
-
}
|
|
190
|
-
} else {
|
|
191
|
-
commandType = builderOrType;
|
|
192
|
-
}
|
|
193
|
-
if (commandType !== enum_index.CommandType.SLASH && commandType !== enum_index.CommandType.CONTEXT_MENU) {
|
|
194
|
-
const { regex: generatedRegex, params, specificity: patternSpecificity } = createRegexFromPattern(commandName);
|
|
195
|
-
regex = generatedRegex;
|
|
196
|
-
dynamicParams = params;
|
|
197
|
-
specificity = patternSpecificity;
|
|
198
|
-
}
|
|
199
|
-
// Ensure commandName supports multiple entries
|
|
200
|
-
if (!commands[commandName]) {
|
|
201
|
-
commands[commandName] = [];
|
|
202
|
-
}
|
|
203
|
-
commands[commandName].push({
|
|
204
|
-
methodName: propertyKey,
|
|
205
|
-
builder: builderInstance,
|
|
206
|
-
type: commandType,
|
|
207
|
-
regex,
|
|
208
|
-
dynamicParams,
|
|
209
|
-
specificity
|
|
210
|
-
});
|
|
211
|
-
Reflect.defineMetadata(COMMAND_METADATA_KEY, commands, target);
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
/**
|
|
215
|
-
* Retrieves the command map for a given controller.
|
|
216
|
-
*
|
|
217
|
-
* @param controller - The controller class instance.
|
|
218
|
-
* @returns A record containing command metadata indexed by command names.
|
|
219
|
-
*/ function getCommandMap(controller) {
|
|
220
|
-
return Reflect.getMetadata(COMMAND_METADATA_KEY, controller);
|
|
221
|
-
}
|
|
222
|
-
/**
|
|
223
|
-
* Decorator to mark a class as a controller that can later be registered to the App class `(app.ts)` using the `@MeoCord` decorator.
|
|
224
|
-
*
|
|
225
|
-
* @example
|
|
226
|
-
* ```typescript
|
|
227
|
-
* @Controller()
|
|
228
|
-
* export class PingSlashController {
|
|
229
|
-
* constructor(private pingService: PingService) {}
|
|
230
|
-
*
|
|
231
|
-
* @Command('ping', PingCommandBuilder)
|
|
232
|
-
* async ping(interaction: ChatInputCommandInteraction) {
|
|
233
|
-
* const response = await this.pingService.handlePing()
|
|
234
|
-
* await interaction.reply(response)
|
|
235
|
-
* }
|
|
236
|
-
* }
|
|
237
|
-
* ```
|
|
238
|
-
*/ function Controller() {
|
|
239
|
-
return function(target) {
|
|
240
|
-
if (!Reflect.hasMetadata(metadataKey_enum.MetadataKey.Injectable, target)) {
|
|
241
|
-
inversify.injectable()(target);
|
|
242
|
-
}
|
|
243
|
-
};
|
|
244
|
-
}
|
|
245
|
-
/**
|
|
246
|
-
* Finds pattern pairs that can both match one customId.
|
|
247
|
-
*
|
|
248
|
-
* Patterns of different segment counts are disjoint, because a parameter cannot cross
|
|
249
|
-
* `/`. Within the same count, two patterns overlap unless some position holds literals
|
|
250
|
-
* that differ: `a/{x}/c` and `a/b/{y}` both take `a/b/c`, and neither is more literal
|
|
251
|
-
* than the other, so ranking cannot settle it either.
|
|
252
|
-
*
|
|
253
|
-
* @param patterns - The registered patterns.
|
|
254
|
-
* @returns Each ambiguous pair, once, in the order the patterns were given.
|
|
255
|
-
*/ function findAmbiguousRoutes(patterns) {
|
|
256
|
-
const isParam = (segment)=>PLACEHOLDER_PATTERN.test(segment);
|
|
257
|
-
const segmentsOf = (pattern)=>pattern.split(PARAM_SEPARATOR);
|
|
258
|
-
const collisions = [];
|
|
259
|
-
for(let i = 0; i < patterns.length; i++){
|
|
260
|
-
for(let j = i + 1; j < patterns.length; j++){
|
|
261
|
-
const left = segmentsOf(patterns[i]);
|
|
262
|
-
const right = segmentsOf(patterns[j]);
|
|
263
|
-
if (left.length !== right.length) continue;
|
|
264
|
-
const disjoint = left.some((segment, index)=>{
|
|
265
|
-
PLACEHOLDER_PATTERN.lastIndex = 0;
|
|
266
|
-
const leftIsParam = isParam(segment);
|
|
267
|
-
PLACEHOLDER_PATTERN.lastIndex = 0;
|
|
268
|
-
const rightIsParam = isParam(right[index]);
|
|
269
|
-
return !leftIsParam && !rightIsParam && segment !== right[index];
|
|
270
|
-
});
|
|
271
|
-
if (!disjoint) collisions.push([
|
|
272
|
-
patterns[i],
|
|
273
|
-
patterns[j]
|
|
274
|
-
]);
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
return collisions;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
exports.Command = Command;
|
|
281
|
-
exports.Controller = Controller;
|
|
282
|
-
exports.MessageHandler = MessageHandler;
|
|
283
|
-
exports.PARAM_SEPARATOR = PARAM_SEPARATOR;
|
|
284
|
-
exports.ReactionHandler = ReactionHandler;
|
|
285
|
-
exports.findAmbiguousRoutes = findAmbiguousRoutes;
|
|
286
|
-
exports.getCommandMap = getCommandMap;
|
|
287
|
-
exports.getMessageHandlers = getMessageHandlers;
|
|
288
|
-
exports.getReactionHandlers = getReactionHandlers;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
declare enum CommandType {
|
|
2
|
-
SLASH = "SLASH",
|
|
3
|
-
BUTTON = "BUTTON",
|
|
4
|
-
CONTEXT_MENU = "CONTEXT_MENU",
|
|
5
|
-
SELECT_MENU = "SELECT_MENU",
|
|
6
|
-
MODAL_SUBMIT = "MODAL_SUBMIT"
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Enum representing actions that can be performed on a message reaction.
|
|
10
|
-
*/
|
|
11
|
-
declare enum ReactionHandlerAction {
|
|
12
|
-
/** Reaction added to a message. */
|
|
13
|
-
ADD = "ADD",
|
|
14
|
-
/** Reaction removed from a message. */
|
|
15
|
-
REMOVE = "REMOVE"
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { CommandType as C, ReactionHandlerAction as R };
|