@pikokr/command.ts 3.0.8-dev.745e02b → 3.0.8-dev.e5806ef
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/.all-contributorsrc +33 -0
- package/README.md +2 -0
- package/dist/error/CommandCheckFailed.d.ts +2 -2
- package/dist/error/CommandCheckFailed.js +2 -2
- package/dist/structures/CommandClient.js +3 -0
- package/package.json +1 -1
- package/src/error/CommandCheckFailed.ts +1 -1
- package/src/structures/CommandClient.ts +5 -0
- package/test/modules/dev.ts +1 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"files": [
|
|
3
|
+
"README.md"
|
|
4
|
+
],
|
|
5
|
+
"imageSize": 100,
|
|
6
|
+
"contributorsPerLine": 7,
|
|
7
|
+
"contributorsSortAlphabetically": false,
|
|
8
|
+
"badgeTemplate": "[](#contributors)",
|
|
9
|
+
"contributorTemplate": "<a href=\"<%= contributor.profile %>\"><img src=\"<%= contributor.avatar_url %>\" width=\"<%= options.imageSize %>px;\" alt=\"\"/><br /><sub><b><%= contributor.name %></b></sub></a>",
|
|
10
|
+
"types": {
|
|
11
|
+
"custom": {
|
|
12
|
+
"symbol": "🔭",
|
|
13
|
+
"description": "A custom contribution type.",
|
|
14
|
+
"link": "[<%= symbol %>](<%= url %> \"<%= description %>\"),"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"skipCi": true,
|
|
18
|
+
"contributors": [
|
|
19
|
+
{
|
|
20
|
+
"login": "pikokr",
|
|
21
|
+
"name": "파링",
|
|
22
|
+
"avatar_url": "https://avatars.githubusercontent.com/u/68010770?v=4",
|
|
23
|
+
"profile": "https://pikokr.dev",
|
|
24
|
+
"contributions": [
|
|
25
|
+
"code"
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"projectName": "command.ts",
|
|
30
|
+
"projectOwner": "pikokr",
|
|
31
|
+
"repoType": "github",
|
|
32
|
+
"repoHost": "https://github.com"
|
|
33
|
+
}
|
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Command.TS
|
|
2
2
|
|
|
3
|
+
[](https://github.com/pikokr/command.ts/actions/workflows/publish.yml)
|
|
4
|
+
|
|
3
5
|

|
|
4
6
|
|
|
5
7
|
Command framework for discord.js
|
|
@@ -7,7 +7,7 @@ export declare class CommandCheckFailed extends Error {
|
|
|
7
7
|
constructor(msg: Message, command: Command);
|
|
8
8
|
}
|
|
9
9
|
export declare class SlashCommandCheckFailed extends Error {
|
|
10
|
-
|
|
10
|
+
interaction: CommandInteraction;
|
|
11
11
|
command: SlashCommand;
|
|
12
|
-
constructor(
|
|
12
|
+
constructor(interaction: CommandInteraction, command: SlashCommand);
|
|
13
13
|
}
|
|
@@ -10,9 +10,9 @@ class CommandCheckFailed extends Error {
|
|
|
10
10
|
}
|
|
11
11
|
exports.CommandCheckFailed = CommandCheckFailed;
|
|
12
12
|
class SlashCommandCheckFailed extends Error {
|
|
13
|
-
constructor(
|
|
13
|
+
constructor(interaction, command) {
|
|
14
14
|
super();
|
|
15
|
-
this.
|
|
15
|
+
this.interaction = interaction;
|
|
16
16
|
this.command = command;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -51,6 +51,9 @@ class CommandClient {
|
|
|
51
51
|
autoSync: true,
|
|
52
52
|
},
|
|
53
53
|
}, options);
|
|
54
|
+
if (this.options.owners !== 'auto') {
|
|
55
|
+
this.owners = this.options.owners;
|
|
56
|
+
}
|
|
54
57
|
this.client.once('ready', () => this.ready());
|
|
55
58
|
this.registry.registerModule(new builtinModules_1.CommandHandler(this.registry));
|
|
56
59
|
this.registry.registerModule(new builtinModules_1.BuiltinCommandConverters(this));
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@ export class CommandCheckFailed extends Error {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export class SlashCommandCheckFailed extends Error {
|
|
12
|
-
constructor(public
|
|
12
|
+
constructor(public interaction: CommandInteraction, public command: SlashCommand) {
|
|
13
13
|
super()
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -74,6 +74,11 @@ export class CommandClient {
|
|
|
74
74
|
},
|
|
75
75
|
options,
|
|
76
76
|
)
|
|
77
|
+
|
|
78
|
+
if (this.options.owners !== 'auto') {
|
|
79
|
+
this.owners = this.options.owners
|
|
80
|
+
}
|
|
81
|
+
|
|
77
82
|
this.client.once('ready', () => this.ready())
|
|
78
83
|
this.registry.registerModule(new CommandHandler(this.registry))
|
|
79
84
|
this.registry.registerModule(new BuiltinCommandConverters(this))
|
package/test/modules/dev.ts
CHANGED
|
@@ -8,7 +8,7 @@ export class Dev extends BuiltInModule {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
@listener('slashCommandError')
|
|
11
|
-
|
|
11
|
+
slashError(e: Error, i: CommandInteraction) {
|
|
12
12
|
if (e instanceof SlashCommandCheckFailed) {
|
|
13
13
|
return i.reply({
|
|
14
14
|
content: 'Command before-run check failed',
|