necord 5.5.3 → 5.5.4-dev.1680611024.635b5ab
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/CHANGELOG.md +12 -0
- package/dist/commands/command.discovery.d.ts +8 -0
- package/dist/commands/command.discovery.js +13 -0
- package/dist/commands/commands.service.d.ts +15 -0
- package/dist/commands/commands.service.js +80 -0
- package/dist/commands/context-menus/context-menu.discovery.d.ts +11 -0
- package/dist/commands/context-menus/context-menu.discovery.js +19 -0
- package/dist/commands/context-menus/context-menus.service.d.ts +18 -0
- package/dist/commands/context-menus/context-menus.service.js +61 -0
- package/dist/commands/context-menus/decorators/context-menu.decorator.d.ts +2 -0
- package/dist/commands/context-menus/decorators/context-menu.decorator.js +8 -0
- package/dist/commands/context-menus/decorators/index.d.ts +4 -0
- package/dist/commands/context-menus/decorators/index.js +20 -0
- package/dist/commands/context-menus/decorators/message-command.decorator.d.ts +2 -0
- package/dist/commands/context-menus/decorators/message-command.decorator.js +7 -0
- package/dist/commands/context-menus/decorators/target.decorator.d.ts +7 -0
- package/dist/commands/context-menus/decorators/target.decorator.js +38 -0
- package/dist/commands/context-menus/decorators/user-command.decorator.d.ts +2 -0
- package/dist/commands/context-menus/decorators/user-command.decorator.js +7 -0
- package/dist/commands/context-menus/index.d.ts +3 -0
- package/dist/commands/context-menus/index.js +19 -0
- package/dist/commands/index.d.ts +4 -0
- package/dist/commands/index.js +20 -0
- package/dist/commands/slash-commands/autocomplete/autocomplete.interceptor.d.ts +7 -0
- package/dist/commands/slash-commands/autocomplete/autocomplete.interceptor.js +39 -0
- package/dist/commands/slash-commands/autocomplete/index.d.ts +1 -0
- package/dist/commands/slash-commands/autocomplete/index.js +17 -0
- package/dist/commands/slash-commands/decorators/index.d.ts +3 -0
- package/dist/commands/slash-commands/decorators/index.js +19 -0
- package/dist/commands/slash-commands/decorators/slash-command.decorator.d.ts +2 -0
- package/dist/commands/slash-commands/decorators/slash-command.decorator.js +9 -0
- package/dist/commands/slash-commands/decorators/subcommand-group.decorator.d.ts +2 -0
- package/dist/commands/slash-commands/decorators/subcommand-group.decorator.js +18 -0
- package/dist/commands/slash-commands/decorators/subcommand.decorator.d.ts +2 -0
- package/dist/commands/slash-commands/decorators/subcommand.decorator.js +9 -0
- package/dist/commands/slash-commands/index.d.ts +5 -0
- package/dist/commands/slash-commands/index.js +21 -0
- package/dist/commands/slash-commands/options/attachment-option.decorator.d.ts +7 -0
- package/dist/commands/slash-commands/options/attachment-option.decorator.js +6 -0
- package/dist/commands/slash-commands/options/boolean-option.decorator.d.ts +7 -0
- package/dist/commands/slash-commands/options/boolean-option.decorator.js +6 -0
- package/dist/commands/slash-commands/options/channel-option.decorator.d.ts +8 -0
- package/dist/commands/slash-commands/options/channel-option.decorator.js +6 -0
- package/dist/commands/slash-commands/options/index.d.ts +11 -0
- package/dist/commands/slash-commands/options/index.js +27 -0
- package/dist/commands/slash-commands/options/integer-option.decorator.d.ts +20 -0
- package/dist/commands/slash-commands/options/integer-option.decorator.js +6 -0
- package/dist/commands/slash-commands/options/member-option.decorator.d.ts +7 -0
- package/dist/commands/slash-commands/options/member-option.decorator.js +6 -0
- package/dist/commands/slash-commands/options/mentionable-option.decorator.d.ts +7 -0
- package/dist/commands/slash-commands/options/mentionable-option.decorator.js +6 -0
- package/dist/commands/slash-commands/options/number-option.decorator.d.ts +20 -0
- package/dist/commands/slash-commands/options/number-option.decorator.js +6 -0
- package/dist/commands/slash-commands/options/option.util.d.ts +5 -0
- package/dist/commands/slash-commands/options/option.util.js +21 -0
- package/dist/commands/slash-commands/options/options.decorator.d.ts +2 -0
- package/dist/commands/slash-commands/options/options.decorator.js +32 -0
- package/dist/commands/slash-commands/options/role-option.decorator.d.ts +7 -0
- package/dist/commands/slash-commands/options/role-option.decorator.js +6 -0
- package/dist/commands/slash-commands/options/string-option.decorator.d.ts +20 -0
- package/dist/commands/slash-commands/options/string-option.decorator.js +6 -0
- package/dist/commands/slash-commands/options/user-option.decorator.d.ts +7 -0
- package/dist/commands/slash-commands/options/user-option.decorator.js +6 -0
- package/dist/commands/slash-commands/slash-command.discovery.d.ts +20 -0
- package/dist/commands/slash-commands/slash-command.discovery.js +44 -0
- package/dist/commands/slash-commands/slash-commands.service.d.ts +20 -0
- package/dist/commands/slash-commands/slash-commands.service.js +89 -0
- package/dist/context/decorators/context.decorator.d.ts +2 -0
- package/dist/context/decorators/context.decorator.js +7 -0
- package/dist/context/decorators/discovery.decorator.d.ts +1 -0
- package/dist/context/decorators/discovery.decorator.js +6 -0
- package/dist/context/decorators/index.d.ts +2 -0
- package/dist/context/decorators/index.js +18 -0
- package/dist/context/decorators/params.util.d.ts +3 -0
- package/dist/context/decorators/params.util.js +12 -0
- package/dist/context/index.d.ts +7 -0
- package/dist/context/index.js +23 -0
- package/dist/context/necord-arguments-host.d.ts +13 -0
- package/dist/context/necord-arguments-host.js +22 -0
- package/dist/context/necord-base.discovery.d.ts +30 -0
- package/dist/context/necord-base.discovery.js +47 -0
- package/dist/context/necord-context.interface.d.ts +22 -0
- package/dist/context/necord-context.interface.js +2 -0
- package/dist/context/necord-execution-context.d.ts +6 -0
- package/dist/context/necord-execution-context.js +13 -0
- package/dist/context/necord-params.factory.d.ts +6 -0
- package/dist/context/necord-params.factory.js +19 -0
- package/dist/context/necord-paramtype.enum.d.ts +4 -0
- package/dist/context/necord-paramtype.enum.js +8 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +25 -0
- package/dist/listeners/decorators/index.d.ts +3 -0
- package/dist/listeners/decorators/index.js +19 -0
- package/dist/listeners/decorators/listener.decorator.d.ts +2 -0
- package/dist/listeners/decorators/listener.decorator.js +8 -0
- package/dist/listeners/decorators/on.decorator.d.ts +2 -0
- package/dist/listeners/decorators/on.decorator.js +6 -0
- package/dist/listeners/decorators/once.decorator.d.ts +2 -0
- package/dist/listeners/decorators/once.decorator.js +6 -0
- package/dist/listeners/index.d.ts +3 -0
- package/dist/listeners/index.js +19 -0
- package/dist/listeners/listener.discovery.d.ts +11 -0
- package/dist/listeners/listener.discovery.js +19 -0
- package/dist/listeners/listener.interface.d.ts +90 -0
- package/dist/listeners/listener.interface.js +2 -0
- package/dist/listeners/listeners.service.d.ts +22 -0
- package/dist/listeners/listeners.service.js +237 -0
- package/dist/message-components/decorators/button.decorator.d.ts +1 -0
- package/dist/message-components/decorators/button.decorator.js +7 -0
- package/dist/message-components/decorators/component-param.decorator.d.ts +1 -0
- package/dist/message-components/decorators/component-param.decorator.js +17 -0
- package/dist/message-components/decorators/index.d.ts +6 -0
- package/dist/message-components/decorators/index.js +22 -0
- package/dist/message-components/decorators/message-component.decorator.d.ts +2 -0
- package/dist/message-components/decorators/message-component.decorator.js +8 -0
- package/dist/message-components/decorators/select-menu.decorator.d.ts +12 -0
- package/dist/message-components/decorators/select-menu.decorator.js +23 -0
- package/dist/message-components/decorators/selected.decorator.d.ts +10 -0
- package/dist/message-components/decorators/selected.decorator.js +40 -0
- package/dist/message-components/decorators/values.decorator.d.ts +7 -0
- package/dist/message-components/decorators/values.decorator.js +17 -0
- package/dist/message-components/index.d.ts +3 -0
- package/dist/message-components/index.js +19 -0
- package/dist/message-components/message-component.discovery.d.ts +14 -0
- package/dist/message-components/message-component.discovery.js +27 -0
- package/dist/message-components/message-components.service.d.ts +16 -0
- package/dist/message-components/message-components.service.js +61 -0
- package/dist/modals/decorators/fields.decorator.d.ts +1 -0
- package/dist/modals/decorators/fields.decorator.js +14 -0
- package/dist/modals/decorators/index.d.ts +3 -0
- package/dist/modals/decorators/index.js +19 -0
- package/dist/modals/decorators/modal-param.decorator.d.ts +1 -0
- package/dist/modals/decorators/modal-param.decorator.js +17 -0
- package/dist/modals/decorators/modal.decorator.d.ts +1 -0
- package/dist/modals/decorators/modal.decorator.js +8 -0
- package/dist/modals/index.d.ts +3 -0
- package/dist/modals/index.js +19 -0
- package/dist/modals/modal.discovery.d.ts +12 -0
- package/dist/modals/modal.discovery.js +24 -0
- package/dist/modals/modals.service.d.ts +15 -0
- package/dist/modals/modals.service.js +56 -0
- package/dist/necord-client.provider.d.ts +3 -0
- package/dist/necord-client.provider.js +10 -0
- package/dist/necord-explorer.service.d.ts +15 -0
- package/dist/necord-explorer.service.js +59 -0
- package/dist/necord-options.interface.d.ts +8 -0
- package/dist/necord-options.interface.js +2 -0
- package/dist/necord-rest.provider.d.ts +3 -0
- package/dist/necord-rest.provider.js +10 -0
- package/dist/necord.constants.d.ts +12 -0
- package/dist/necord.constants.js +19 -0
- package/dist/necord.module.d.ts +11 -0
- package/dist/necord.module.js +71 -0
- package/dist/text-commands/decorators/arguments.decorator.d.ts +2 -0
- package/dist/text-commands/decorators/arguments.decorator.js +14 -0
- package/dist/text-commands/decorators/index.d.ts +2 -0
- package/dist/text-commands/decorators/index.js +18 -0
- package/dist/text-commands/decorators/text-command.decorator.d.ts +2 -0
- package/dist/text-commands/decorators/text-command.decorator.js +8 -0
- package/dist/text-commands/index.d.ts +3 -0
- package/dist/text-commands/index.js +19 -0
- package/dist/text-commands/text-command.discovery.d.ts +11 -0
- package/dist/text-commands/text-command.discovery.js +19 -0
- package/dist/text-commands/text-commands.service.d.ts +17 -0
- package/dist/text-commands/text-commands.service.js +78 -0
- package/package.json +6 -6
- package/tsconfig.build.json +23 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
|
|
4
|
+
# [5.5.4](https://github.com/necordjs/necord/compare/v5.5.3...v5.5.4) - (2023-04-03)
|
|
5
|
+
|
|
6
|
+
## Bug Fixes
|
|
7
|
+
|
|
8
|
+
- Add tsconfig for build and tests ([2abef6c](https://github.com/necordjs/necord/commit/2abef6c9c0a75344b56b743d121493551cf88726))
|
|
9
|
+
|
|
10
|
+
# [5.5.3](https://github.com/necordjs/necord/compare/v5.5.2...v5.5.3) - (2023-04-01)
|
|
11
|
+
|
|
12
|
+
## Testing
|
|
13
|
+
|
|
14
|
+
- Include tsconfig tests ([be370ec](https://github.com/necordjs/necord/commit/be370ec08752164361d00207306051e9df6d4352))
|
|
15
|
+
|
|
4
16
|
# [5.5.0](https://github.com/necordjs/necord/compare/v5.4.8...v5.5.0) - (2023-03-09)
|
|
5
17
|
|
|
6
18
|
## Bug Fixes
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseApplicationCommandData, Snowflake } from 'discord.js';
|
|
2
|
+
import { NecordBaseDiscovery } from '../context';
|
|
3
|
+
export declare abstract class CommandDiscovery<T extends BaseApplicationCommandData & {
|
|
4
|
+
guilds?: Snowflake[];
|
|
5
|
+
} = BaseApplicationCommandData> extends NecordBaseDiscovery<T> {
|
|
6
|
+
getName(): string;
|
|
7
|
+
getGuilds(): Snowflake[];
|
|
8
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CommandDiscovery = void 0;
|
|
4
|
+
const context_1 = require("../context");
|
|
5
|
+
class CommandDiscovery extends context_1.NecordBaseDiscovery {
|
|
6
|
+
getName() {
|
|
7
|
+
return this.meta.name;
|
|
8
|
+
}
|
|
9
|
+
getGuilds() {
|
|
10
|
+
return this.meta.guilds;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.CommandDiscovery = CommandDiscovery;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { OnModuleInit } from '@nestjs/common';
|
|
2
|
+
import { Client } from 'discord.js';
|
|
3
|
+
import { NecordModuleOptions } from '../necord-options.interface';
|
|
4
|
+
import { ContextMenusService } from './context-menus';
|
|
5
|
+
import { SlashCommandsService } from './slash-commands';
|
|
6
|
+
export declare class CommandsService implements OnModuleInit {
|
|
7
|
+
private readonly client;
|
|
8
|
+
private readonly options;
|
|
9
|
+
private readonly contextMenusService;
|
|
10
|
+
private readonly slashCommandsService;
|
|
11
|
+
private readonly logger;
|
|
12
|
+
constructor(client: Client, options: NecordModuleOptions, contextMenusService: ContextMenusService, slashCommandsService: SlashCommandsService);
|
|
13
|
+
onModuleInit(): Client<boolean>;
|
|
14
|
+
register(client: Client): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
var CommandsService_1;
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.CommandsService = void 0;
|
|
26
|
+
const common_1 = require("@nestjs/common");
|
|
27
|
+
const necord_constants_1 = require("../necord.constants");
|
|
28
|
+
const discord_js_1 = require("discord.js");
|
|
29
|
+
const context_menus_1 = require("./context-menus");
|
|
30
|
+
const slash_commands_1 = require("./slash-commands");
|
|
31
|
+
let CommandsService = CommandsService_1 = class CommandsService {
|
|
32
|
+
constructor(client, options, contextMenusService, slashCommandsService) {
|
|
33
|
+
this.client = client;
|
|
34
|
+
this.options = options;
|
|
35
|
+
this.contextMenusService = contextMenusService;
|
|
36
|
+
this.slashCommandsService = slashCommandsService;
|
|
37
|
+
this.logger = new common_1.Logger(CommandsService_1.name);
|
|
38
|
+
}
|
|
39
|
+
onModuleInit() {
|
|
40
|
+
if (this.options.skipRegistration) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
return this.client.once('ready', (client) => __awaiter(this, void 0, void 0, function* () { return this.register(client); }));
|
|
44
|
+
}
|
|
45
|
+
register(client) {
|
|
46
|
+
var _a, _b;
|
|
47
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
if (client.application.partial) {
|
|
49
|
+
yield client.application.fetch();
|
|
50
|
+
}
|
|
51
|
+
const clientCommands = client.application.commands;
|
|
52
|
+
const commands = [
|
|
53
|
+
...this.contextMenusService.getCommands(),
|
|
54
|
+
...this.slashCommandsService.getCommands()
|
|
55
|
+
];
|
|
56
|
+
const commandsByGuildMap = new Map([[undefined, []]]);
|
|
57
|
+
for (const command of commands) {
|
|
58
|
+
const guilds = Array.isArray(this.options.development)
|
|
59
|
+
? this.options.development
|
|
60
|
+
: (_a = command.getGuilds()) !== null && _a !== void 0 ? _a : [undefined];
|
|
61
|
+
for (const guildId of guilds) {
|
|
62
|
+
const visitedCommands = (_b = commandsByGuildMap.get(guildId)) !== null && _b !== void 0 ? _b : [];
|
|
63
|
+
commandsByGuildMap.set(guildId, visitedCommands.concat(command));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
this.logger.log(`Started refreshing application commands.`);
|
|
67
|
+
for (const [guild, commands] of commandsByGuildMap) {
|
|
68
|
+
yield clientCommands.set(commands.flatMap(command => command.toJSON()), guild);
|
|
69
|
+
}
|
|
70
|
+
this.logger.log(`Successfully reloaded application commands.`);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
CommandsService = CommandsService_1 = __decorate([
|
|
75
|
+
(0, common_1.Injectable)(),
|
|
76
|
+
__param(1, (0, common_1.Inject)(necord_constants_1.NECORD_MODULE_OPTIONS)),
|
|
77
|
+
__metadata("design:paramtypes", [discord_js_1.Client, Object, context_menus_1.ContextMenusService,
|
|
78
|
+
slash_commands_1.SlashCommandsService])
|
|
79
|
+
], CommandsService);
|
|
80
|
+
exports.CommandsService = CommandsService;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ContextMenuCommandInteraction, MessageApplicationCommandData, Snowflake, UserApplicationCommandData } from 'discord.js';
|
|
2
|
+
import { CommandDiscovery } from '../command.discovery';
|
|
3
|
+
export type ContextMenuMeta = (MessageApplicationCommandData | UserApplicationCommandData) & {
|
|
4
|
+
guilds?: Snowflake[];
|
|
5
|
+
};
|
|
6
|
+
export declare class ContextMenuDiscovery extends CommandDiscovery<ContextMenuMeta> {
|
|
7
|
+
getType(): import("discord.js").ApplicationCommandType.User | import("discord.js").ApplicationCommandType.Message;
|
|
8
|
+
isContextMenu(): this is ContextMenuDiscovery;
|
|
9
|
+
execute(interaction: ContextMenuCommandInteraction): any;
|
|
10
|
+
toJSON(): ContextMenuMeta;
|
|
11
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ContextMenuDiscovery = void 0;
|
|
4
|
+
const command_discovery_1 = require("../command.discovery");
|
|
5
|
+
class ContextMenuDiscovery extends command_discovery_1.CommandDiscovery {
|
|
6
|
+
getType() {
|
|
7
|
+
return this.meta.type;
|
|
8
|
+
}
|
|
9
|
+
isContextMenu() {
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
execute(interaction) {
|
|
13
|
+
return super.execute([interaction]);
|
|
14
|
+
}
|
|
15
|
+
toJSON() {
|
|
16
|
+
return this.meta;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.ContextMenuDiscovery = ContextMenuDiscovery;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Client } from 'discord.js';
|
|
2
|
+
import { OnApplicationBootstrap, OnModuleInit } from '@nestjs/common';
|
|
3
|
+
import { ContextMenuDiscovery, ContextMenuMeta } from './context-menu.discovery';
|
|
4
|
+
import { ExplorerService } from '../../necord-explorer.service';
|
|
5
|
+
import { CommandDiscovery } from '../command.discovery';
|
|
6
|
+
export declare class ContextMenusService implements OnModuleInit, OnApplicationBootstrap {
|
|
7
|
+
private readonly client;
|
|
8
|
+
private readonly explorerService;
|
|
9
|
+
private readonly logger;
|
|
10
|
+
private readonly contextMenus;
|
|
11
|
+
constructor(client: Client, explorerService: ExplorerService<ContextMenuDiscovery>);
|
|
12
|
+
onModuleInit(): void;
|
|
13
|
+
onApplicationBootstrap(): Client<boolean>;
|
|
14
|
+
getCommands(): CommandDiscovery[];
|
|
15
|
+
add(contextMenu: ContextMenuDiscovery): void;
|
|
16
|
+
remove(type: ContextMenuMeta['type'], name: ContextMenuMeta['name']): boolean;
|
|
17
|
+
private getId;
|
|
18
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var ContextMenusService_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.ContextMenusService = void 0;
|
|
14
|
+
const discord_js_1 = require("discord.js");
|
|
15
|
+
const common_1 = require("@nestjs/common");
|
|
16
|
+
const necord_constants_1 = require("../../necord.constants");
|
|
17
|
+
const necord_explorer_service_1 = require("../../necord-explorer.service");
|
|
18
|
+
let ContextMenusService = ContextMenusService_1 = class ContextMenusService {
|
|
19
|
+
constructor(client, explorerService) {
|
|
20
|
+
this.client = client;
|
|
21
|
+
this.explorerService = explorerService;
|
|
22
|
+
this.logger = new common_1.Logger(ContextMenusService_1.name);
|
|
23
|
+
this.contextMenus = new Map();
|
|
24
|
+
}
|
|
25
|
+
onModuleInit() {
|
|
26
|
+
return this.explorerService
|
|
27
|
+
.explore(necord_constants_1.CONTEXT_MENU_METADATA)
|
|
28
|
+
.forEach(contextMenu => this.add(contextMenu));
|
|
29
|
+
}
|
|
30
|
+
onApplicationBootstrap() {
|
|
31
|
+
return this.client.on('interactionCreate', interaction => {
|
|
32
|
+
var _a;
|
|
33
|
+
if (!interaction.isContextMenuCommand())
|
|
34
|
+
return;
|
|
35
|
+
return (_a = this.contextMenus
|
|
36
|
+
.get(this.getId(interaction.commandType, interaction.commandName))) === null || _a === void 0 ? void 0 : _a.execute(interaction);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
getCommands() {
|
|
40
|
+
return [...this.contextMenus.values()];
|
|
41
|
+
}
|
|
42
|
+
add(contextMenu) {
|
|
43
|
+
const id = this.getId(contextMenu.getType(), contextMenu.getName());
|
|
44
|
+
if (this.contextMenus.has(id)) {
|
|
45
|
+
this.logger.warn(`ContextMenu with id : ${id} is already exists`);
|
|
46
|
+
}
|
|
47
|
+
this.contextMenus.set(id, contextMenu);
|
|
48
|
+
}
|
|
49
|
+
remove(type, name) {
|
|
50
|
+
return this.contextMenus.delete(this.getId(type, name));
|
|
51
|
+
}
|
|
52
|
+
getId(type, name) {
|
|
53
|
+
return type.toString().concat(':', name);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
ContextMenusService = ContextMenusService_1 = __decorate([
|
|
57
|
+
(0, common_1.Injectable)(),
|
|
58
|
+
__metadata("design:paramtypes", [discord_js_1.Client,
|
|
59
|
+
necord_explorer_service_1.ExplorerService])
|
|
60
|
+
], ContextMenusService);
|
|
61
|
+
exports.ContextMenusService = ContextMenusService;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ContextMenu = void 0;
|
|
4
|
+
const context_menu_discovery_1 = require("../context-menu.discovery");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const necord_constants_1 = require("../../../necord.constants");
|
|
7
|
+
const ContextMenu = (options) => (0, common_1.SetMetadata)(necord_constants_1.CONTEXT_MENU_METADATA, new context_menu_discovery_1.ContextMenuDiscovery(options));
|
|
8
|
+
exports.ContextMenu = ContextMenu;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./context-menu.decorator"), exports);
|
|
18
|
+
__exportStar(require("./message-command.decorator"), exports);
|
|
19
|
+
__exportStar(require("./user-command.decorator"), exports);
|
|
20
|
+
__exportStar(require("./target.decorator"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MessageCommand = void 0;
|
|
4
|
+
const discord_js_1 = require("discord.js");
|
|
5
|
+
const context_menu_decorator_1 = require("./context-menu.decorator");
|
|
6
|
+
const MessageCommand = (options) => (0, context_menu_decorator_1.ContextMenu)(Object.assign({ type: discord_js_1.ApplicationCommandType.Message }, options));
|
|
7
|
+
exports.MessageCommand = MessageCommand;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Use `@TargetMessage`, `@TargetUser` or `@TargetMember` instead
|
|
3
|
+
*/
|
|
4
|
+
export declare const Target: (...dataOrPipes: any[]) => ParameterDecorator;
|
|
5
|
+
export declare const TargetMessage: (...dataOrPipes: any[]) => ParameterDecorator;
|
|
6
|
+
export declare const TargetUser: (...dataOrPipes: any[]) => ParameterDecorator;
|
|
7
|
+
export declare const TargetMember: (...dataOrPipes: any[]) => ParameterDecorator;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TargetMember = exports.TargetUser = exports.TargetMessage = exports.Target = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
const context_1 = require("../../../context");
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Use `@TargetMessage`, `@TargetUser` or `@TargetMember` instead
|
|
8
|
+
*/
|
|
9
|
+
exports.Target = (0, common_1.createParamDecorator)((_, context) => {
|
|
10
|
+
const necordContext = context_1.NecordExecutionContext.create(context);
|
|
11
|
+
const [interaction] = necordContext.getContext();
|
|
12
|
+
if (!interaction.isContextMenuCommand())
|
|
13
|
+
return null;
|
|
14
|
+
return interaction.isMessageContextMenuCommand()
|
|
15
|
+
? interaction.options.getMessage('message')
|
|
16
|
+
: interaction.options.getUser('user');
|
|
17
|
+
});
|
|
18
|
+
exports.TargetMessage = (0, common_1.createParamDecorator)((_, context) => {
|
|
19
|
+
const necordContext = context_1.NecordExecutionContext.create(context);
|
|
20
|
+
const [interaction] = necordContext.getContext();
|
|
21
|
+
if (!interaction.isMessageContextMenuCommand())
|
|
22
|
+
return null;
|
|
23
|
+
return interaction.targetMessage;
|
|
24
|
+
});
|
|
25
|
+
exports.TargetUser = (0, common_1.createParamDecorator)((_, context) => {
|
|
26
|
+
const necordContext = context_1.NecordExecutionContext.create(context);
|
|
27
|
+
const [interaction] = necordContext.getContext();
|
|
28
|
+
if (!interaction.isUserContextMenuCommand())
|
|
29
|
+
return null;
|
|
30
|
+
return interaction.targetUser;
|
|
31
|
+
});
|
|
32
|
+
exports.TargetMember = (0, common_1.createParamDecorator)((_, context) => {
|
|
33
|
+
const necordContext = context_1.NecordExecutionContext.create(context);
|
|
34
|
+
const [interaction] = necordContext.getContext();
|
|
35
|
+
if (!interaction.isUserContextMenuCommand())
|
|
36
|
+
return null;
|
|
37
|
+
return interaction.targetMember;
|
|
38
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserCommand = void 0;
|
|
4
|
+
const discord_js_1 = require("discord.js");
|
|
5
|
+
const context_menu_decorator_1 = require("./context-menu.decorator");
|
|
6
|
+
const UserCommand = (options) => (0, context_menu_decorator_1.ContextMenu)(Object.assign({ type: discord_js_1.ApplicationCommandType.User }, options));
|
|
7
|
+
exports.UserCommand = UserCommand;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./decorators"), exports);
|
|
18
|
+
__exportStar(require("./context-menu.discovery"), exports);
|
|
19
|
+
__exportStar(require("./context-menus.service"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./context-menus"), exports);
|
|
18
|
+
__exportStar(require("./slash-commands"), exports);
|
|
19
|
+
__exportStar(require("./command.discovery"), exports);
|
|
20
|
+
__exportStar(require("./commands.service"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CallHandler, ExecutionContext, NestInterceptor } from '@nestjs/common';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { AutocompleteInteraction } from 'discord.js';
|
|
4
|
+
export declare abstract class AutocompleteInterceptor implements NestInterceptor {
|
|
5
|
+
abstract transformOptions(interaction: AutocompleteInteraction): void | Promise<void>;
|
|
6
|
+
intercept(context: ExecutionContext, next: CallHandler<any>): Promise<Observable<any>>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
9
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
10
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
11
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
12
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
13
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
14
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.AutocompleteInterceptor = void 0;
|
|
19
|
+
const common_1 = require("@nestjs/common");
|
|
20
|
+
const rxjs_1 = require("rxjs");
|
|
21
|
+
const context_1 = require("../../../context");
|
|
22
|
+
const discord_js_1 = require("discord.js");
|
|
23
|
+
let AutocompleteInterceptor = class AutocompleteInterceptor {
|
|
24
|
+
intercept(context, next) {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
const necordContext = context_1.NecordExecutionContext.create(context);
|
|
27
|
+
const [interaction] = necordContext.getContext();
|
|
28
|
+
const discovery = necordContext.getDiscovery();
|
|
29
|
+
if (interaction.type !== discord_js_1.InteractionType.ApplicationCommandAutocomplete ||
|
|
30
|
+
!discovery.isSlashCommand())
|
|
31
|
+
return next.handle();
|
|
32
|
+
return (0, rxjs_1.of)(this.transformOptions(interaction));
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
AutocompleteInterceptor = __decorate([
|
|
37
|
+
(0, common_1.Injectable)()
|
|
38
|
+
], AutocompleteInterceptor);
|
|
39
|
+
exports.AutocompleteInterceptor = AutocompleteInterceptor;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './autocomplete.interceptor';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./autocomplete.interceptor"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./slash-command.decorator"), exports);
|
|
18
|
+
__exportStar(require("./subcommand.decorator"), exports);
|
|
19
|
+
__exportStar(require("./subcommand-group.decorator"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SlashCommand = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
const slash_command_discovery_1 = require("../slash-command.discovery");
|
|
6
|
+
const necord_constants_1 = require("../../../necord.constants");
|
|
7
|
+
const discord_js_1 = require("discord.js");
|
|
8
|
+
const SlashCommand = (options) => (0, common_1.SetMetadata)(necord_constants_1.SLASH_COMMAND_METADATA, new slash_command_discovery_1.SlashCommandDiscovery(Object.assign({ type: discord_js_1.ApplicationCommandType.ChatInput }, options)));
|
|
9
|
+
exports.SlashCommand = SlashCommand;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createCommandGroupDecorator = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
const necord_constants_1 = require("../../../necord.constants");
|
|
6
|
+
const discord_js_1 = require("discord.js");
|
|
7
|
+
const slash_command_discovery_1 = require("../slash-command.discovery");
|
|
8
|
+
const slash_command_decorator_1 = require("./slash-command.decorator");
|
|
9
|
+
const rxjs_1 = require("rxjs");
|
|
10
|
+
const SubcommandGroup = (options) => (0, common_1.SetMetadata)(necord_constants_1.SUBCOMMAND_GROUP_METADATA, new slash_command_discovery_1.SlashCommandDiscovery(Object.assign({ type: discord_js_1.ApplicationCommandOptionType.SubcommandGroup }, options)));
|
|
11
|
+
const createCommandGroupDecorator = (rootOptions) => {
|
|
12
|
+
const rootCommand = (0, slash_command_decorator_1.SlashCommand)(rootOptions);
|
|
13
|
+
return (subOptions) => {
|
|
14
|
+
const subCommandGroup = subOptions ? SubcommandGroup(subOptions) : rxjs_1.noop;
|
|
15
|
+
return (0, common_1.applyDecorators)(rootCommand, subCommandGroup);
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
exports.createCommandGroupDecorator = createCommandGroupDecorator;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Subcommand = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
const slash_command_discovery_1 = require("../slash-command.discovery");
|
|
6
|
+
const necord_constants_1 = require("../../../necord.constants");
|
|
7
|
+
const discord_js_1 = require("discord.js");
|
|
8
|
+
const Subcommand = (options) => (0, common_1.SetMetadata)(necord_constants_1.SUBCOMMAND_METADATA, new slash_command_discovery_1.SlashCommandDiscovery(Object.assign({ type: discord_js_1.ApplicationCommandOptionType.Subcommand }, options)));
|
|
9
|
+
exports.Subcommand = Subcommand;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./autocomplete"), exports);
|
|
18
|
+
__exportStar(require("./decorators"), exports);
|
|
19
|
+
__exportStar(require("./options"), exports);
|
|
20
|
+
__exportStar(require("./slash-command.discovery"), exports);
|
|
21
|
+
__exportStar(require("./slash-commands.service"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const AttachmentOption: (data: {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
name_localizations?: Partial<Record<"id" | "en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
5
|
+
description_localizations?: Partial<Record<"id" | "en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
}) => PropertyDecorator;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AttachmentOption = void 0;
|
|
4
|
+
const discord_js_1 = require("discord.js");
|
|
5
|
+
const option_util_1 = require("./option.util");
|
|
6
|
+
exports.AttachmentOption = (0, option_util_1.createOptionDecorator)(discord_js_1.ApplicationCommandOptionType.Attachment, 'getAttachment');
|