reciple 2.0.2 → 3.0.0-pre.1
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/README.md +0 -6
- package/bin/reciple/classes/RecipleClient.js +2 -2
- package/bin/reciple/classes/builders/InteractionCommandBuilder.d.ts +2 -2
- package/bin/reciple/classes/builders/MessageCommandBuilder.d.ts +2 -2
- package/bin/reciple/permissions.d.ts +2 -2
- package/bin/reciple/permissions.js +1 -1
- package/package.json +3 -3
- package/resource/reciple.yml +2 -4
package/README.md
CHANGED
|
@@ -17,12 +17,6 @@ To install the bot, run the following command in your terminal:
|
|
|
17
17
|
```bash
|
|
18
18
|
npm i reciple
|
|
19
19
|
```
|
|
20
|
-
```bash
|
|
21
|
-
yarn add reciple
|
|
22
|
-
```
|
|
23
|
-
```bash
|
|
24
|
-
pnpm add reciple
|
|
25
|
-
```
|
|
26
20
|
|
|
27
21
|
You can initialize the bot to the current directory with the following command in your terminal:
|
|
28
22
|
|
|
@@ -161,7 +161,7 @@ class RecipleClient extends discord_js_1.Client {
|
|
|
161
161
|
client: this
|
|
162
162
|
};
|
|
163
163
|
if ((0, permissions_1.userHasCommandPermissions)(command.name, (_a = message.member) === null || _a === void 0 ? void 0 : _a.permissions, this.config.permissions.messageCommands, command)) {
|
|
164
|
-
if (!command.allowExecuteInDM && message.channel.type ===
|
|
164
|
+
if (!command.allowExecuteInDM && message.channel.type === discord_js_1.ChannelType.DM
|
|
165
165
|
|| !command.allowExecuteByBots
|
|
166
166
|
&& (message.author.bot || message.author.system)
|
|
167
167
|
|| (0, isIgnoredChannel_1.isIgnoredChannel)(message.channelId, this.config.ignoredChannels))
|
|
@@ -224,7 +224,7 @@ class RecipleClient extends discord_js_1.Client {
|
|
|
224
224
|
interactionCommandExecute(interaction) {
|
|
225
225
|
var _a, _b;
|
|
226
226
|
return __awaiter(this, void 0, void 0, function* () {
|
|
227
|
-
if (!interaction ||
|
|
227
|
+
if (!interaction || interaction.type !== discord_js_1.InteractionType.ApplicationCommand || !this.isReady())
|
|
228
228
|
return;
|
|
229
229
|
const command = this.findCommand(interaction.commandName, 'INTERACTION_COMMAND');
|
|
230
230
|
if (!command)
|
|
@@ -13,7 +13,7 @@ export declare class InteractionCommandBuilder extends SlashCommandBuilder {
|
|
|
13
13
|
requiredBotPermissions: PermissionResolvable[];
|
|
14
14
|
RequiredUserPermissions: PermissionResolvable[];
|
|
15
15
|
allowExecuteInDM: boolean;
|
|
16
|
-
halt?: (haltData: RecipleHaltedCommandData<InteractionCommandBuilder>) => Awaitable<boolean>;
|
|
16
|
+
halt?: (haltData: RecipleHaltedCommandData<InteractionCommandBuilder>) => Awaitable<boolean | void>;
|
|
17
17
|
execute: (executeData: RecipleInteractionCommandExecuteData) => Awaitable<void>;
|
|
18
18
|
/**
|
|
19
19
|
* Sets the execute cooldown for this command.
|
|
@@ -27,7 +27,7 @@ export declare class InteractionCommandBuilder extends SlashCommandBuilder {
|
|
|
27
27
|
/**
|
|
28
28
|
* Function when the command is interupted before execution
|
|
29
29
|
*/
|
|
30
|
-
setHalt(halt?: (haltData: RecipleHaltedCommandData<InteractionCommandBuilder>) => Awaitable<boolean>): InteractionCommandBuilder;
|
|
30
|
+
setHalt(halt?: (haltData: RecipleHaltedCommandData<InteractionCommandBuilder>) => Awaitable<boolean | void>): InteractionCommandBuilder;
|
|
31
31
|
/**
|
|
32
32
|
* Function when the command is executed
|
|
33
33
|
*/
|
|
@@ -30,7 +30,7 @@ export declare class MessageCommandBuilder {
|
|
|
30
30
|
RequiredUserPermissions: PermissionResolvable[];
|
|
31
31
|
allowExecuteInDM: boolean;
|
|
32
32
|
allowExecuteByBots: boolean;
|
|
33
|
-
halt?: (haltData: RecipleHaltedCommandData<MessageCommandBuilder>) => Awaitable<boolean>;
|
|
33
|
+
halt?: (haltData: RecipleHaltedCommandData<MessageCommandBuilder>) => Awaitable<boolean | void>;
|
|
34
34
|
execute: (executeData: RecipleMessageCommandExecuteData) => void;
|
|
35
35
|
/**
|
|
36
36
|
* Sets the command name
|
|
@@ -68,7 +68,7 @@ export declare class MessageCommandBuilder {
|
|
|
68
68
|
/**
|
|
69
69
|
* Function when the command is interupted before execution
|
|
70
70
|
*/
|
|
71
|
-
setHalt(halt?: (haltData: RecipleHaltedCommandData<MessageCommandBuilder>) => Awaitable<boolean>): MessageCommandBuilder;
|
|
71
|
+
setHalt(halt?: (haltData: RecipleHaltedCommandData<MessageCommandBuilder>) => Awaitable<boolean | void>): MessageCommandBuilder;
|
|
72
72
|
/**
|
|
73
73
|
* Function when the command is executed
|
|
74
74
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Guild, PermissionResolvable,
|
|
1
|
+
import { Guild, PermissionResolvable, PermissionsBitField } from 'discord.js';
|
|
2
2
|
import { RecipleCommandBuilders } from './types/builders';
|
|
3
3
|
import { Config } from './classes/RecipleConfig';
|
|
4
4
|
/**
|
|
5
5
|
* Check if the user has permissions to execute the given command name
|
|
6
6
|
*/
|
|
7
|
-
export declare function userHasCommandPermissions(commandName: string, memberPermissions?:
|
|
7
|
+
export declare function userHasCommandPermissions(commandName: string, memberPermissions?: PermissionsBitField, configConmmandPermissions?: Config['permissions']['messageCommands'] | Config['permissions']['interactionCommands'], builder?: RecipleCommandBuilders): boolean;
|
|
8
8
|
export declare function botHasExecutePermissions(guild?: Guild, requiredPermissions?: PermissionResolvable[]): boolean;
|
|
@@ -18,6 +18,6 @@ function botHasExecutePermissions(guild, requiredPermissions) {
|
|
|
18
18
|
var _a;
|
|
19
19
|
if (!(requiredPermissions === null || requiredPermissions === void 0 ? void 0 : requiredPermissions.length))
|
|
20
20
|
return true;
|
|
21
|
-
return (guild === null || guild === void 0 ? void 0 : guild.me) ? (_a = guild.me) === null || _a === void 0 ? void 0 : _a.permissions.has(requiredPermissions) : false;
|
|
21
|
+
return (guild === null || guild === void 0 ? void 0 : guild.members.me) ? (_a = guild.members.me) === null || _a === void 0 ? void 0 : _a.permissions.has(requiredPermissions) : false;
|
|
22
22
|
}
|
|
23
23
|
exports.botHasExecutePermissions = botHasExecutePermissions;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reciple",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-pre.1",
|
|
4
4
|
"description": "Handler for Discord.js",
|
|
5
5
|
"author": "FalloutStudios",
|
|
6
6
|
"homepage": "https://reciple.js.org",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"chalk": "4.1.2",
|
|
39
|
-
"commander": "^9.
|
|
39
|
+
"commander": "^9.4.0",
|
|
40
40
|
"dotenv": "^16.0.1",
|
|
41
41
|
"fallout-utility": "^1.4.2",
|
|
42
42
|
"semver": "^7.3.7",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/node": "^18.0.3",
|
|
48
48
|
"@types/semver": "^7.3.10",
|
|
49
|
-
"discord.js": "^
|
|
49
|
+
"discord.js": "^14.0.2",
|
|
50
50
|
"typescript": "^4.7.4"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
package/resource/reciple.yml
CHANGED
|
@@ -74,11 +74,9 @@ fileLogging:
|
|
|
74
74
|
logFilePath: './logs/latest.log'
|
|
75
75
|
|
|
76
76
|
# Client options
|
|
77
|
+
# Use an intent calculator like https://discord-intents-calculator.vercel.app/ to get valid intents
|
|
77
78
|
client:
|
|
78
|
-
intents:
|
|
79
|
-
- 'GUILDS'
|
|
80
|
-
- 'GUILD_MEMBERS'
|
|
81
|
-
- 'GUILD_MESSAGES'
|
|
79
|
+
intents: 33283
|
|
82
80
|
|
|
83
81
|
# Bot replies
|
|
84
82
|
messages:
|