necord 5.0.0-dev.1657934869.b8030ff → 5.0.2
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/.release-it.json +1 -1
- package/CHANGELOG.md +67 -0
- package/dist/commands/command.discovery.d.ts +5 -5
- package/dist/commands/command.discovery.js +11 -11
- package/dist/commands/commands.service.d.ts +14 -14
- package/dist/commands/commands.service.js +74 -74
- package/dist/commands/context-menus/context-menu.discovery.d.ts +9 -9
- package/dist/commands/context-menus/context-menu.discovery.js +19 -26
- package/dist/commands/context-menus/context-menus.service.d.ts +14 -14
- package/dist/commands/context-menus/context-menus.service.js +46 -46
- package/dist/commands/context-menus/decorators/context-menu.decorator.d.ts +2 -2
- package/dist/commands/context-menus/decorators/context-menu.decorator.js +8 -8
- package/dist/commands/context-menus/decorators/index.d.ts +4 -4
- package/dist/commands/context-menus/decorators/index.js +20 -20
- package/dist/commands/context-menus/decorators/message-command.decorator.d.ts +2 -2
- package/dist/commands/context-menus/decorators/message-command.decorator.js +7 -7
- package/dist/commands/context-menus/decorators/target.decorator.d.ts +1 -1
- package/dist/commands/context-menus/decorators/target.decorator.js +14 -14
- package/dist/commands/context-menus/decorators/user-command.decorator.d.ts +2 -2
- package/dist/commands/context-menus/decorators/user-command.decorator.js +7 -7
- package/dist/commands/context-menus/index.d.ts +3 -3
- package/dist/commands/context-menus/index.js +19 -19
- package/dist/commands/index.d.ts +4 -4
- package/dist/commands/index.js +20 -20
- package/dist/commands/slash-commands/autocomplete/autocomplete.interceptor.d.ts +7 -7
- package/dist/commands/slash-commands/autocomplete/autocomplete.interceptor.js +39 -39
- package/dist/commands/slash-commands/autocomplete/index.d.ts +1 -1
- package/dist/commands/slash-commands/autocomplete/index.js +17 -17
- package/dist/commands/slash-commands/decorators/index.d.ts +3 -3
- package/dist/commands/slash-commands/decorators/index.js +19 -19
- package/dist/commands/slash-commands/decorators/slash-command.decorator.d.ts +2 -2
- package/dist/commands/slash-commands/decorators/slash-command.decorator.js +9 -9
- package/dist/commands/slash-commands/decorators/subcommand-group.decorator.d.ts +2 -2
- package/dist/commands/slash-commands/decorators/subcommand-group.decorator.js +18 -18
- package/dist/commands/slash-commands/decorators/subcommand.decorator.d.ts +2 -2
- package/dist/commands/slash-commands/decorators/subcommand.decorator.js +9 -9
- package/dist/commands/slash-commands/index.d.ts +5 -5
- package/dist/commands/slash-commands/index.js +21 -21
- package/dist/commands/slash-commands/options/attachment-option.decorator.d.ts +7 -7
- package/dist/commands/slash-commands/options/attachment-option.decorator.js +6 -6
- package/dist/commands/slash-commands/options/boolean-option.decorator.d.ts +7 -7
- package/dist/commands/slash-commands/options/boolean-option.decorator.js +6 -6
- package/dist/commands/slash-commands/options/channel-option.decorator.d.ts +8 -8
- package/dist/commands/slash-commands/options/channel-option.decorator.js +6 -6
- package/dist/commands/slash-commands/options/index.d.ts +11 -11
- package/dist/commands/slash-commands/options/index.js +27 -27
- package/dist/commands/slash-commands/options/integer-option.decorator.d.ts +20 -20
- package/dist/commands/slash-commands/options/integer-option.decorator.js +6 -6
- package/dist/commands/slash-commands/options/member-option.decorator.d.ts +7 -7
- package/dist/commands/slash-commands/options/member-option.decorator.js +6 -6
- package/dist/commands/slash-commands/options/mentionable-option.decorator.d.ts +7 -7
- package/dist/commands/slash-commands/options/mentionable-option.decorator.js +6 -6
- package/dist/commands/slash-commands/options/number-option.decorator.d.ts +20 -20
- package/dist/commands/slash-commands/options/number-option.decorator.js +6 -6
- package/dist/commands/slash-commands/options/option.util.d.ts +5 -5
- package/dist/commands/slash-commands/options/option.util.js +21 -21
- package/dist/commands/slash-commands/options/options.decorator.d.ts +2 -2
- package/dist/commands/slash-commands/options/options.decorator.js +32 -32
- package/dist/commands/slash-commands/options/role-option.decorator.d.ts +7 -7
- package/dist/commands/slash-commands/options/role-option.decorator.js +6 -6
- package/dist/commands/slash-commands/options/string-option.decorator.d.ts +20 -20
- package/dist/commands/slash-commands/options/string-option.decorator.js +6 -6
- package/dist/commands/slash-commands/options/user-option.decorator.d.ts +7 -7
- package/dist/commands/slash-commands/options/user-option.decorator.js +6 -6
- package/dist/commands/slash-commands/slash-command.discovery.d.ts +19 -19
- package/dist/commands/slash-commands/slash-command.discovery.js +44 -44
- package/dist/commands/slash-commands/slash-commands.service.d.ts +16 -16
- package/dist/commands/slash-commands/slash-commands.service.js +77 -77
- package/dist/context/decorators/context.decorator.d.ts +2 -2
- package/dist/context/decorators/context.decorator.js +7 -7
- package/dist/context/decorators/discovery.decorator.d.ts +1 -1
- package/dist/context/decorators/discovery.decorator.js +6 -6
- package/dist/context/decorators/index.d.ts +2 -2
- package/dist/context/decorators/index.js +18 -18
- package/dist/context/decorators/params.util.d.ts +3 -3
- package/dist/context/decorators/params.util.js +12 -12
- package/dist/context/index.d.ts +7 -7
- package/dist/context/index.js +23 -23
- package/dist/context/necord-arguments-host.d.ts +13 -13
- package/dist/context/necord-arguments-host.js +22 -22
- package/dist/context/necord-base.discovery.d.ts +30 -30
- package/dist/context/necord-base.discovery.js +47 -47
- package/dist/context/necord-context.interface.d.ts +11 -11
- package/dist/context/necord-context.interface.js +2 -2
- package/dist/context/necord-execution-context.d.ts +6 -6
- package/dist/context/necord-execution-context.js +13 -13
- package/dist/context/necord-params.factory.d.ts +6 -6
- package/dist/context/necord-params.factory.js +19 -19
- package/dist/context/necord-paramtype.enum.d.ts +4 -4
- package/dist/context/necord-paramtype.enum.js +8 -8
- package/dist/index.d.ts +9 -9
- package/dist/index.js +25 -25
- package/dist/listeners/decorators/index.d.ts +3 -3
- package/dist/listeners/decorators/index.js +19 -19
- package/dist/listeners/decorators/listener.decorator.d.ts +2 -2
- package/dist/listeners/decorators/listener.decorator.js +8 -8
- package/dist/listeners/decorators/on.decorator.d.ts +2 -2
- package/dist/listeners/decorators/on.decorator.js +6 -6
- package/dist/listeners/decorators/once.decorator.d.ts +2 -2
- package/dist/listeners/decorators/once.decorator.js +6 -6
- package/dist/listeners/index.d.ts +3 -3
- package/dist/listeners/index.js +19 -19
- package/dist/listeners/listener.discovery.d.ts +11 -11
- package/dist/listeners/listener.discovery.js +19 -19
- package/dist/listeners/listener.interface.d.ts +90 -86
- package/dist/listeners/listener.interface.js +2 -2
- package/dist/listeners/listeners.service.d.ts +22 -22
- package/dist/listeners/listeners.service.js +237 -237
- package/dist/message-components/decorators/button.decorator.d.ts +1 -1
- package/dist/message-components/decorators/button.decorator.js +7 -7
- package/dist/message-components/decorators/index.d.ts +4 -4
- package/dist/message-components/decorators/index.js +20 -20
- package/dist/message-components/decorators/message-component.decorator.d.ts +2 -2
- package/dist/message-components/decorators/message-component.decorator.js +8 -8
- package/dist/message-components/decorators/select-menu.decorator.d.ts +1 -1
- package/dist/message-components/decorators/select-menu.decorator.js +7 -7
- package/dist/message-components/decorators/values.decorator.d.ts +1 -1
- package/dist/message-components/decorators/values.decorator.js +10 -10
- package/dist/message-components/index.d.ts +3 -3
- package/dist/message-components/index.js +19 -19
- package/dist/message-components/message-component.discovery.d.ts +13 -13
- package/dist/message-components/message-component.discovery.js +22 -22
- package/dist/message-components/message-components.service.d.ts +12 -12
- package/dist/message-components/message-components.service.js +44 -44
- package/dist/modals/decorators/fields.decorator.d.ts +1 -1
- package/dist/modals/decorators/fields.decorator.js +14 -14
- package/dist/modals/decorators/index.d.ts +2 -2
- package/dist/modals/decorators/index.js +18 -18
- package/dist/modals/decorators/modal.decorator.d.ts +1 -1
- package/dist/modals/decorators/modal.decorator.js +8 -8
- package/dist/modals/index.d.ts +3 -3
- package/dist/modals/index.js +19 -19
- package/dist/modals/modal.discovery.d.ts +11 -11
- package/dist/modals/modal.discovery.js +19 -19
- package/dist/modals/modals.service.d.ts +12 -12
- package/dist/modals/modals.service.js +42 -42
- package/dist/necord-client.provider.d.ts +3 -3
- package/dist/necord-client.provider.js +10 -10
- package/dist/necord-explorer.service.d.ts +15 -15
- package/dist/necord-explorer.service.js +59 -59
- package/dist/necord-options.interface.d.ts +16 -16
- package/dist/necord-options.interface.js +2 -2
- package/dist/necord.constants.d.ts +11 -11
- package/dist/necord.constants.js +14 -14
- package/dist/necord.module.d.ts +14 -14
- package/dist/necord.module.js +115 -115
- package/dist/text-commands/decorators/arguments.decorator.d.ts +2 -2
- package/dist/text-commands/decorators/arguments.decorator.js +14 -14
- package/dist/text-commands/decorators/index.d.ts +2 -2
- package/dist/text-commands/decorators/index.js +18 -18
- package/dist/text-commands/decorators/text-command.decorator.d.ts +2 -2
- package/dist/text-commands/decorators/text-command.decorator.js +8 -8
- package/dist/text-commands/index.d.ts +3 -3
- package/dist/text-commands/index.js +19 -19
- package/dist/text-commands/text-command.discovery.d.ts +11 -11
- package/dist/text-commands/text-command.discovery.js +19 -19
- package/dist/text-commands/text-commands.service.d.ts +14 -14
- package/dist/text-commands/text-commands.service.js +66 -66
- package/package.json +4 -4
package/.release-it.json
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
All notable changes to this project will be documented in this file.
|
|
3
|
+
|
|
4
|
+
# [5.0.1](https://github.com/necordjs/necord/compare/v4.3.3...v5.0.1) - (2022-07-17)
|
|
5
|
+
|
|
6
|
+
## Bug Fixes
|
|
7
|
+
|
|
8
|
+
- Types for guild features lmao ([d6f3727](https://github.com/necordjs/necord/commit/d6f3727fa60f0639de7a439d8299ee095ac7659c))
|
|
9
|
+
- Change `SlashCommandContext` type ([3d111da](https://github.com/necordjs/necord/commit/3d111dac386d89045975a2c60b2c1c8c09f92797))
|
|
10
|
+
- Change autocomplete type, tysm djs :) ([a1d1400](https://github.com/necordjs/necord/commit/a1d1400879ecdcaac8c1d826cf17f03b668251e5))
|
|
11
|
+
- Remove update topic event ([82403a4](https://github.com/necordjs/necord/commit/82403a49610f8997b933ecbd6d40310273775abf))
|
|
12
|
+
- Remove update topic event ([061470c](https://github.com/necordjs/necord/commit/061470cc3e8be62ec5de9ba3799f6cf4c0f34674))
|
|
13
|
+
- Change description localizations property ([d20d658](https://github.com/necordjs/necord/commit/d20d65883be04c07749536a0c5f4756cab1b053d))
|
|
14
|
+
- Context and event interfaces ([60b7002](https://github.com/necordjs/necord/commit/60b700277539bfbd17f6a47c450d6b70ab22ca85))
|
|
15
|
+
- Add check for subcommands ([7b3a07a](https://github.com/necordjs/necord/commit/7b3a07ad449f99b69a4716d49f2199da76d1dca7))
|
|
16
|
+
- Remove locals due memory leak ([6857e01](https://github.com/necordjs/necord/commit/6857e0134dbf605a998df62e0d7e038408b83ed1))
|
|
17
|
+
- Inherited arguments ([a4a74f3](https://github.com/necordjs/necord/commit/a4a74f3524ff53ed77acf4440a8b288b284c030e))
|
|
18
|
+
- Types ([3196848](https://github.com/necordjs/necord/commit/3196848b54d8c78ccdafaceafceb83465e8df8a2))
|
|
19
|
+
- Remove rest provider ([b24948e](https://github.com/necordjs/necord/commit/b24948ed70b1daba361d81860c0101a46b6fdeab))
|
|
20
|
+
|
|
21
|
+
## Documentation
|
|
22
|
+
|
|
23
|
+
- Add git cliff for changelog ([a1e8168](https://github.com/necordjs/necord/commit/a1e81689e7f3756456a12304f33f8822db6eda83))
|
|
24
|
+
|
|
25
|
+
## Features
|
|
26
|
+
|
|
27
|
+
- Support last breaking changes from djs ([6442ff3](https://github.com/necordjs/necord/commit/6442ff3934aa7803c4045668d2e15feb3764abd1))
|
|
28
|
+
- Add error for registering subcommands w/o root command ([3111de3](https://github.com/necordjs/necord/commit/3111de37db112cf325ddce2a0cbbf14d46f310ab))
|
|
29
|
+
- Target decorator for context menus ([044c701](https://github.com/necordjs/necord/commit/044c701c89589863c097b2bac527e7e9dfe93716))
|
|
30
|
+
- Support subcommands ([5d23173](https://github.com/necordjs/necord/commit/5d231738bf04f165aa2d1f36d815fd4ea9e07a06))
|
|
31
|
+
- Support last 14 version djs ([7a58e06](https://github.com/necordjs/necord/commit/7a58e06747d725a75258aec5e724c7ef5231918e))
|
|
32
|
+
- Add nsfw property ([8179940](https://github.com/necordjs/necord/commit/8179940f6455fe34d732036d0f1996adc02865f8))
|
|
33
|
+
- Discordjs 14, modals, attachment option ([6dfbe8d](https://github.com/necordjs/necord/commit/6dfbe8d62ba8b0232fbfd9eb7b03fdc72a291d16))
|
|
34
|
+
|
|
35
|
+
## Refactor
|
|
36
|
+
|
|
37
|
+
- Make autocomplete as interceptor ([80c9f0b](https://github.com/necordjs/necord/commit/80c9f0b8c76ffeebe1d8a65bacbcf97b968537a0))
|
|
38
|
+
- Change explorer service template and name ([369f7cc](https://github.com/necordjs/necord/commit/369f7cc0943679e944b30eedb7bbc8edb129a988))
|
|
39
|
+
- Explorer templates ([aa0ea19](https://github.com/necordjs/necord/commit/aa0ea195b46c4ae12f6e5a95bb0989af523a133e))
|
|
40
|
+
- Remove custom function from explorer ([d7a4121](https://github.com/necordjs/necord/commit/d7a41216e8f43ff6fb93419066697528397a0e26))
|
|
41
|
+
- Use discord.js imports ([85121f7](https://github.com/necordjs/necord/commit/85121f7c6bedf955d3bf8742e146559381cde049))
|
|
42
|
+
- Change flow for commands and discovery, support permissions v2 ([c3dea7e](https://github.com/necordjs/necord/commit/c3dea7efd8d028aa163b5f0b3fce090382668804))
|
|
43
|
+
- Change slash command interface and decorator to object ([bd0853b](https://github.com/necordjs/necord/commit/bd0853bd405ac3492942bd1f622fc1ea58c839f8))
|
|
44
|
+
- Change interfaces ([05b8079](https://github.com/necordjs/necord/commit/05b807948f646f0c3458ce0c582076d38b2fc762))
|
|
45
|
+
- Change flow and folder structure ([3e2edc0](https://github.com/necordjs/necord/commit/3e2edc0a81118c73e97480dde60465b33f6ee26f))
|
|
46
|
+
- Use object instead inline for context menus ([0b27dca](https://github.com/necordjs/necord/commit/0b27dca45a16de708caffd42bf6929328141e359))
|
|
47
|
+
- Change decorators type ([1f7a48d](https://github.com/necordjs/necord/commit/1f7a48d407e899066abbc565254b85a0ac6ea502))
|
|
48
|
+
- Some improvements ([4ac637d](https://github.com/necordjs/necord/commit/4ac637d7e024d3daf50342b592cde8ce2c4033f8))
|
|
49
|
+
- Remove cooldown guard, use @nestjs/throttle! ([c57a237](https://github.com/necordjs/necord/commit/c57a23736642120bf27ffe170a05f9846e5c3230))
|
|
50
|
+
|
|
51
|
+
## Styling
|
|
52
|
+
|
|
53
|
+
- Change `cliff.toml` ([6c889ac](https://github.com/necordjs/necord/commit/6c889ac019c9361401b1d83187b5ffa67a80d19b))
|
|
54
|
+
- Lint ([61eb75b](https://github.com/necordjs/necord/commit/61eb75b5530c768c79665ebe04462a61a9b63c86))
|
|
55
|
+
- Add lint-staged ([bfa8c31](https://github.com/necordjs/necord/commit/bfa8c31f674a7912df60f3f216d113712b8d8fb7))
|
|
56
|
+
- Lint ([47a959a](https://github.com/necordjs/necord/commit/47a959a2be348a05eb33d693824a4355cb84068e))
|
|
57
|
+
|
|
58
|
+
## Testing
|
|
59
|
+
|
|
60
|
+
- Getting context menu data from `@Options` ([e3d9181](https://github.com/necordjs/necord/commit/e3d918159051f5155dd936b6c87f0f8a55723cf3))
|
|
61
|
+
- Remove old decorators ([15eb501](https://github.com/necordjs/necord/commit/15eb501c16da92c89dc12eee91b1b072ab27f13b))
|
|
62
|
+
- Remove discovery from text command ([d1588a6](https://github.com/necordjs/necord/commit/d1588a60fd5f38afab7afc2352acb729a5d061b4))
|
|
63
|
+
- Change flow and add message-component spec ([1eabdbe](https://github.com/necordjs/necord/commit/1eabdbef141f5674aee698ddfd60d2f78395617b))
|
|
64
|
+
- Wtf ([8c3824b](https://github.com/necordjs/necord/commit/8c3824b095db7ed1523f21b57a285d1c56d54ce2))
|
|
65
|
+
- Change intents for client ([e1b1797](https://github.com/necordjs/necord/commit/e1b1797ca3a7aaf2f77b30371831cc5e1a2685ec))
|
|
66
|
+
- Change text command inline to object ([85980a7](https://github.com/necordjs/necord/commit/85980a7602d1debb6b4f4ec32d159c7b2474d8a9))
|
|
67
|
+
- Make global guilds ([c612b45](https://github.com/necordjs/necord/commit/c612b45e7c003f4e7f34e706ea7ed1b7e17761d6))
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseApplicationCommandData } from 'discord.js';
|
|
2
|
-
import { NecordBaseDiscovery } from '../context';
|
|
3
|
-
export declare abstract class CommandDiscovery<T extends BaseApplicationCommandData = BaseApplicationCommandData> extends NecordBaseDiscovery<T> {
|
|
4
|
-
getName(): string;
|
|
5
|
-
}
|
|
1
|
+
import { BaseApplicationCommandData } from 'discord.js';
|
|
2
|
+
import { NecordBaseDiscovery } from '../context';
|
|
3
|
+
export declare abstract class CommandDiscovery<T extends BaseApplicationCommandData = BaseApplicationCommandData> extends NecordBaseDiscovery<T> {
|
|
4
|
+
getName(): string;
|
|
5
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CommandDiscovery = void 0;
|
|
4
|
-
const context_1 = require("../context");
|
|
5
|
-
// TODO: Add guild parameter
|
|
6
|
-
class CommandDiscovery extends context_1.NecordBaseDiscovery {
|
|
7
|
-
getName() {
|
|
8
|
-
return this.meta.name;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.CommandDiscovery = CommandDiscovery;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CommandDiscovery = void 0;
|
|
4
|
+
const context_1 = require("../context");
|
|
5
|
+
// TODO: Add guild parameter
|
|
6
|
+
class CommandDiscovery extends context_1.NecordBaseDiscovery {
|
|
7
|
+
getName() {
|
|
8
|
+
return this.meta.name;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.CommandDiscovery = CommandDiscovery;
|
|
@@ -1,14 +1,14 @@
|
|
|
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
|
-
}
|
|
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
|
+
}
|
|
@@ -1,74 +1,74 @@
|
|
|
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
|
-
return this.client.once('ready', (client) => __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
var _a;
|
|
42
|
-
if (client.application.partial) {
|
|
43
|
-
yield client.application.fetch();
|
|
44
|
-
}
|
|
45
|
-
const clientCommands = client.application.commands;
|
|
46
|
-
const commands = [
|
|
47
|
-
...this.contextMenusService.getCommands(),
|
|
48
|
-
...this.slashCommandsService.getCommands()
|
|
49
|
-
];
|
|
50
|
-
const commandsByGuildMap = new Map([[undefined, []]]);
|
|
51
|
-
for (const command of commands) {
|
|
52
|
-
const defaultGuild = Array.isArray(this.options.development)
|
|
53
|
-
? this.options.development
|
|
54
|
-
: [undefined];
|
|
55
|
-
for (const guild of defaultGuild) {
|
|
56
|
-
const visitedCommands = (_a = commandsByGuildMap.get(guild)) !== null && _a !== void 0 ? _a : [];
|
|
57
|
-
commandsByGuildMap.set(guild, visitedCommands.concat(command));
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
this.logger.log(`Started refreshing application commands.`);
|
|
61
|
-
for (const [guild, commands] of commandsByGuildMap) {
|
|
62
|
-
yield clientCommands.set(commands.flatMap(command => command.toJSON()), guild);
|
|
63
|
-
}
|
|
64
|
-
this.logger.log(`Successfully reloaded application commands.`);
|
|
65
|
-
}));
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
CommandsService = CommandsService_1 = __decorate([
|
|
69
|
-
(0, common_1.Injectable)(),
|
|
70
|
-
__param(1, (0, common_1.Inject)(necord_constants_1.NECORD_MODULE_OPTIONS)),
|
|
71
|
-
__metadata("design:paramtypes", [discord_js_1.Client, Object, context_menus_1.ContextMenusService,
|
|
72
|
-
slash_commands_1.SlashCommandsService])
|
|
73
|
-
], CommandsService);
|
|
74
|
-
exports.CommandsService = CommandsService;
|
|
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
|
+
return this.client.once('ready', (client) => __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
var _a;
|
|
42
|
+
if (client.application.partial) {
|
|
43
|
+
yield client.application.fetch();
|
|
44
|
+
}
|
|
45
|
+
const clientCommands = client.application.commands;
|
|
46
|
+
const commands = [
|
|
47
|
+
...this.contextMenusService.getCommands(),
|
|
48
|
+
...this.slashCommandsService.getCommands()
|
|
49
|
+
];
|
|
50
|
+
const commandsByGuildMap = new Map([[undefined, []]]);
|
|
51
|
+
for (const command of commands) {
|
|
52
|
+
const defaultGuild = Array.isArray(this.options.development)
|
|
53
|
+
? this.options.development
|
|
54
|
+
: [undefined];
|
|
55
|
+
for (const guild of defaultGuild) {
|
|
56
|
+
const visitedCommands = (_a = commandsByGuildMap.get(guild)) !== null && _a !== void 0 ? _a : [];
|
|
57
|
+
commandsByGuildMap.set(guild, visitedCommands.concat(command));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
this.logger.log(`Started refreshing application commands.`);
|
|
61
|
+
for (const [guild, commands] of commandsByGuildMap) {
|
|
62
|
+
yield clientCommands.set(commands.flatMap(command => command.toJSON()), guild);
|
|
63
|
+
}
|
|
64
|
+
this.logger.log(`Successfully reloaded application commands.`);
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
CommandsService = CommandsService_1 = __decorate([
|
|
69
|
+
(0, common_1.Injectable)(),
|
|
70
|
+
__param(1, (0, common_1.Inject)(necord_constants_1.NECORD_MODULE_OPTIONS)),
|
|
71
|
+
__metadata("design:paramtypes", [discord_js_1.Client, Object, context_menus_1.ContextMenusService,
|
|
72
|
+
slash_commands_1.SlashCommandsService])
|
|
73
|
+
], CommandsService);
|
|
74
|
+
exports.CommandsService = CommandsService;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ContextMenuCommandInteraction, MessageApplicationCommandData, UserApplicationCommandData } from 'discord.js';
|
|
2
|
-
import { CommandDiscovery } from '../command.discovery';
|
|
3
|
-
export declare type ContextMenuMeta = MessageApplicationCommandData | UserApplicationCommandData;
|
|
4
|
-
export declare class ContextMenuDiscovery extends CommandDiscovery<ContextMenuMeta> {
|
|
5
|
-
getType(): import("discord.js").ApplicationCommandType.User | import("discord.js").ApplicationCommandType.Message;
|
|
6
|
-
isContextMenu(): this is ContextMenuDiscovery;
|
|
7
|
-
execute(interaction: ContextMenuCommandInteraction): any;
|
|
8
|
-
toJSON(): ContextMenuMeta;
|
|
9
|
-
}
|
|
1
|
+
import { ContextMenuCommandInteraction, MessageApplicationCommandData, UserApplicationCommandData } from 'discord.js';
|
|
2
|
+
import { CommandDiscovery } from '../command.discovery';
|
|
3
|
+
export declare type ContextMenuMeta = MessageApplicationCommandData | UserApplicationCommandData;
|
|
4
|
+
export declare class ContextMenuDiscovery extends CommandDiscovery<ContextMenuMeta> {
|
|
5
|
+
getType(): import("discord.js").ApplicationCommandType.User | import("discord.js").ApplicationCommandType.Message;
|
|
6
|
+
isContextMenu(): this is ContextMenuDiscovery;
|
|
7
|
+
execute(interaction: ContextMenuCommandInteraction): any;
|
|
8
|
+
toJSON(): ContextMenuMeta;
|
|
9
|
+
}
|
|
@@ -1,26 +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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
toJSON() {
|
|
23
|
-
return this.meta;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
exports.ContextMenuDiscovery = ContextMenuDiscovery;
|
|
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;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { OnApplicationBootstrap, OnModuleInit } from '@nestjs/common';
|
|
2
|
-
import { ContextMenuDiscovery } from './context-menu.discovery';
|
|
3
|
-
import { Client } from 'discord.js';
|
|
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 contextMenus;
|
|
10
|
-
constructor(client: Client, explorerService: ExplorerService<ContextMenuDiscovery>);
|
|
11
|
-
onModuleInit(): void;
|
|
12
|
-
onApplicationBootstrap(): Client<boolean>;
|
|
13
|
-
getCommands(): CommandDiscovery[];
|
|
14
|
-
}
|
|
1
|
+
import { OnApplicationBootstrap, OnModuleInit } from '@nestjs/common';
|
|
2
|
+
import { ContextMenuDiscovery } from './context-menu.discovery';
|
|
3
|
+
import { Client } from 'discord.js';
|
|
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 contextMenus;
|
|
10
|
+
constructor(client: Client, explorerService: ExplorerService<ContextMenuDiscovery>);
|
|
11
|
+
onModuleInit(): void;
|
|
12
|
+
onApplicationBootstrap(): Client<boolean>;
|
|
13
|
+
getCommands(): CommandDiscovery[];
|
|
14
|
+
}
|
|
@@ -1,46 +1,46 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ContextMenusService = void 0;
|
|
13
|
-
const common_1 = require("@nestjs/common");
|
|
14
|
-
const discord_js_1 = require("discord.js");
|
|
15
|
-
const necord_constants_1 = require("../../necord.constants");
|
|
16
|
-
const necord_explorer_service_1 = require("../../necord-explorer.service");
|
|
17
|
-
let ContextMenusService = class ContextMenusService {
|
|
18
|
-
constructor(client, explorerService) {
|
|
19
|
-
this.client = client;
|
|
20
|
-
this.explorerService = explorerService;
|
|
21
|
-
this.contextMenus = new Map();
|
|
22
|
-
}
|
|
23
|
-
onModuleInit() {
|
|
24
|
-
return this.explorerService
|
|
25
|
-
.explore(necord_constants_1.CONTEXT_MENU_METADATA)
|
|
26
|
-
.forEach(contextMenu => this.contextMenus.set(contextMenu.getType().toString().concat(':', contextMenu.getName()), contextMenu));
|
|
27
|
-
}
|
|
28
|
-
onApplicationBootstrap() {
|
|
29
|
-
return this.client.on('interactionCreate', interaction => {
|
|
30
|
-
var _a;
|
|
31
|
-
if (!interaction.isContextMenuCommand())
|
|
32
|
-
return;
|
|
33
|
-
return (_a = this.contextMenus
|
|
34
|
-
.get(interaction.commandType.toString().concat(':', interaction.commandName))) === null || _a === void 0 ? void 0 : _a.execute(interaction);
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
getCommands() {
|
|
38
|
-
return [...this.contextMenus.values()];
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
ContextMenusService = __decorate([
|
|
42
|
-
(0, common_1.Injectable)(),
|
|
43
|
-
__metadata("design:paramtypes", [discord_js_1.Client,
|
|
44
|
-
necord_explorer_service_1.ExplorerService])
|
|
45
|
-
], ContextMenusService);
|
|
46
|
-
exports.ContextMenusService = ContextMenusService;
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ContextMenusService = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const discord_js_1 = require("discord.js");
|
|
15
|
+
const necord_constants_1 = require("../../necord.constants");
|
|
16
|
+
const necord_explorer_service_1 = require("../../necord-explorer.service");
|
|
17
|
+
let ContextMenusService = class ContextMenusService {
|
|
18
|
+
constructor(client, explorerService) {
|
|
19
|
+
this.client = client;
|
|
20
|
+
this.explorerService = explorerService;
|
|
21
|
+
this.contextMenus = new Map();
|
|
22
|
+
}
|
|
23
|
+
onModuleInit() {
|
|
24
|
+
return this.explorerService
|
|
25
|
+
.explore(necord_constants_1.CONTEXT_MENU_METADATA)
|
|
26
|
+
.forEach(contextMenu => this.contextMenus.set(contextMenu.getType().toString().concat(':', contextMenu.getName()), contextMenu));
|
|
27
|
+
}
|
|
28
|
+
onApplicationBootstrap() {
|
|
29
|
+
return this.client.on('interactionCreate', interaction => {
|
|
30
|
+
var _a;
|
|
31
|
+
if (!interaction.isContextMenuCommand())
|
|
32
|
+
return;
|
|
33
|
+
return (_a = this.contextMenus
|
|
34
|
+
.get(interaction.commandType.toString().concat(':', interaction.commandName))) === null || _a === void 0 ? void 0 : _a.execute(interaction);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
getCommands() {
|
|
38
|
+
return [...this.contextMenus.values()];
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
ContextMenusService = __decorate([
|
|
42
|
+
(0, common_1.Injectable)(),
|
|
43
|
+
__metadata("design:paramtypes", [discord_js_1.Client,
|
|
44
|
+
necord_explorer_service_1.ExplorerService])
|
|
45
|
+
], ContextMenusService);
|
|
46
|
+
exports.ContextMenusService = ContextMenusService;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ContextMenuMeta } from '../context-menu.discovery';
|
|
2
|
-
export declare const ContextMenu: (options: ContextMenuMeta) => import("@nestjs/common").CustomDecorator<string>;
|
|
1
|
+
import { ContextMenuMeta } from '../context-menu.discovery';
|
|
2
|
+
export declare const ContextMenu: (options: ContextMenuMeta) => import("@nestjs/common").CustomDecorator<string>;
|
|
@@ -1,8 +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;
|
|
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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './context-menu.decorator';
|
|
2
|
-
export * from './message-command.decorator';
|
|
3
|
-
export * from './user-command.decorator';
|
|
4
|
-
export * from './target.decorator';
|
|
1
|
+
export * from './context-menu.decorator';
|
|
2
|
+
export * from './message-command.decorator';
|
|
3
|
+
export * from './user-command.decorator';
|
|
4
|
+
export * from './target.decorator';
|
|
@@ -1,20 +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);
|
|
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);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ContextMenuMeta } from '../context-menu.discovery';
|
|
2
|
-
export declare const MessageCommand: (options: Omit<ContextMenuMeta, 'type'>) => import("@nestjs/common").CustomDecorator<string>;
|
|
1
|
+
import { ContextMenuMeta } from '../context-menu.discovery';
|
|
2
|
+
export declare const MessageCommand: (options: Omit<ContextMenuMeta, 'type'>) => import("@nestjs/common").CustomDecorator<string>;
|
|
@@ -1,7 +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;
|
|
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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const Target: (...dataOrPipes: any[]) => ParameterDecorator;
|
|
1
|
+
export declare const Target: (...dataOrPipes: any[]) => ParameterDecorator;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Target = void 0;
|
|
4
|
-
const common_1 = require("@nestjs/common");
|
|
5
|
-
const context_1 = require("../../../context");
|
|
6
|
-
exports.Target = (0, common_1.createParamDecorator)((_, context) => {
|
|
7
|
-
const necordContext = context_1.NecordExecutionContext.create(context);
|
|
8
|
-
const [interaction] = necordContext.getContext();
|
|
9
|
-
if (!interaction.isContextMenuCommand())
|
|
10
|
-
return null;
|
|
11
|
-
return interaction.isMessageContextMenuCommand()
|
|
12
|
-
? interaction.options.getMessage('message')
|
|
13
|
-
: interaction.options.getUser('user');
|
|
14
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Target = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
const context_1 = require("../../../context");
|
|
6
|
+
exports.Target = (0, common_1.createParamDecorator)((_, context) => {
|
|
7
|
+
const necordContext = context_1.NecordExecutionContext.create(context);
|
|
8
|
+
const [interaction] = necordContext.getContext();
|
|
9
|
+
if (!interaction.isContextMenuCommand())
|
|
10
|
+
return null;
|
|
11
|
+
return interaction.isMessageContextMenuCommand()
|
|
12
|
+
? interaction.options.getMessage('message')
|
|
13
|
+
: interaction.options.getUser('user');
|
|
14
|
+
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ContextMenuMeta } from '../context-menu.discovery';
|
|
2
|
-
export declare const UserCommand: (options: Omit<ContextMenuMeta, 'type'>) => import("@nestjs/common").CustomDecorator<string>;
|
|
1
|
+
import { ContextMenuMeta } from '../context-menu.discovery';
|
|
2
|
+
export declare const UserCommand: (options: Omit<ContextMenuMeta, 'type'>) => import("@nestjs/common").CustomDecorator<string>;
|