reciple 1.1.2 → 1.1.3
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ClientOptions,
|
|
1
|
+
import { ClientOptions, MessagePayload, PermissionResolvable } from 'discord.js';
|
|
2
2
|
export interface Config {
|
|
3
3
|
token: string;
|
|
4
4
|
prefix: string;
|
|
@@ -44,7 +44,7 @@ export interface Config {
|
|
|
44
44
|
};
|
|
45
45
|
client: ClientOptions;
|
|
46
46
|
messages: {
|
|
47
|
-
[key: string]:
|
|
47
|
+
[key: string]: MessagePayload | string;
|
|
48
48
|
};
|
|
49
49
|
modulesFolder: string;
|
|
50
50
|
version?: string;
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { Message, PermissionFlags } from 'discord.js';
|
|
2
2
|
import { Command } from 'fallout-utility';
|
|
3
3
|
import { RecipleClient } from '../Client';
|
|
4
|
-
export
|
|
5
|
-
command?: string;
|
|
6
|
-
args?: string[];
|
|
7
|
-
raw?: string;
|
|
8
|
-
prefix?: string;
|
|
9
|
-
separator?: string;
|
|
10
|
-
}
|
|
4
|
+
export declare type CommandMessage = Command;
|
|
11
5
|
export interface RecipleMessageCommandExecute {
|
|
12
6
|
message: Message;
|
|
13
7
|
command: CommandMessage;
|
|
@@ -11,7 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.registerInteractionCommands = void 0;
|
|
13
13
|
function registerInteractionCommands(client, cmds) {
|
|
14
|
-
var _a, _b, _c, _d;
|
|
14
|
+
var _a, _b, _c, _d, _e, _f;
|
|
15
15
|
return __awaiter(this, void 0, void 0, function* () {
|
|
16
16
|
const commands = (_a = Object.values(cmds !== null && cmds !== void 0 ? cmds : client.commands.INTERACTION_COMMANDS).map(c => {
|
|
17
17
|
if (typeof c.toJSON !== 'undefined')
|
|
@@ -23,14 +23,14 @@ function registerInteractionCommands(client, cmds) {
|
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
25
|
if (!((_b = client.config) === null || _b === void 0 ? void 0 : _b.commands.interactionCommand.guilds.length)) {
|
|
26
|
-
yield ((_c = client.application) === null || _c === void 0 ? void 0 : _c.commands.set(commands).catch(e => client.logger.error(e)));
|
|
26
|
+
yield ((_d = (_c = client.application) === null || _c === void 0 ? void 0 : _c.commands.set(commands)) === null || _d === void 0 ? void 0 : _d.catch(e => client.logger.error(e)));
|
|
27
27
|
client.logger.warn('No guilds were specified for interaction commands. Registered commands for all guilds.');
|
|
28
28
|
}
|
|
29
29
|
else {
|
|
30
30
|
const guilds = typeof client.config.commands.interactionCommand.guilds === 'string' ? [client.config.commands.interactionCommand.guilds] : client.config.commands.interactionCommand.guilds;
|
|
31
31
|
client.logger.warn(`Registering ${commands.length} interaction commands for ${guilds.length} guild(s).`);
|
|
32
32
|
for (const guild of guilds) {
|
|
33
|
-
yield ((
|
|
33
|
+
yield ((_f = (_e = client.application) === null || _e === void 0 ? void 0 : _e.commands.set(commands, guild)) === null || _f === void 0 ? void 0 : _f.catch(e => client.logger.error(e)));
|
|
34
34
|
client.logger.warn(`Registered ${commands.length} interaction commands for ${guild}.`);
|
|
35
35
|
}
|
|
36
36
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reciple",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "A Discord.js bot",
|
|
5
5
|
"author": "FalloutStudios",
|
|
6
6
|
"license": "GPL-3.0",
|
|
@@ -19,19 +19,19 @@
|
|
|
19
19
|
"clean": "rimraf bin",
|
|
20
20
|
"compile": "yarn clean && tsc",
|
|
21
21
|
"build": "yarn compile && npm un reciple -g && npm i ./ -g",
|
|
22
|
-
"build:publish": "yarn run build &&
|
|
22
|
+
"build:publish": "yarn run build && yarn publish",
|
|
23
23
|
"test": "cd test && reciple",
|
|
24
24
|
"test:compile": "yarn run build && yarn test:run"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"commander": "^9.2.0",
|
|
28
|
-
"discord.js": "^13.
|
|
29
|
-
"dotenv": "^16.0.
|
|
30
|
-
"fallout-utility": "^1.3.
|
|
31
|
-
"yaml": "^2.0
|
|
28
|
+
"discord.js": "^13.7.0",
|
|
29
|
+
"dotenv": "^16.0.1",
|
|
30
|
+
"fallout-utility": "^1.3.14",
|
|
31
|
+
"yaml": "^2.1.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@types/node": "^17.0.
|
|
34
|
+
"@types/node": "^17.0.33",
|
|
35
35
|
"typescript": "^4.6.4"
|
|
36
36
|
}
|
|
37
37
|
}
|
package/resource/reciple.yml
CHANGED
|
@@ -1,41 +1,69 @@
|
|
|
1
|
+
# Your bot token here
|
|
2
|
+
# To use env variable as a token just do it like this env:TOKEN_ENV
|
|
1
3
|
token: TOKEN
|
|
4
|
+
|
|
5
|
+
# Message command prefix
|
|
2
6
|
prefix: '!'
|
|
3
7
|
|
|
8
|
+
|
|
9
|
+
# Commands options
|
|
4
10
|
commands:
|
|
5
11
|
messageCommand:
|
|
12
|
+
# enable message commands
|
|
6
13
|
enabled: true
|
|
14
|
+
# reply when an error occured
|
|
7
15
|
replyOnError: false
|
|
16
|
+
# command argument separator
|
|
8
17
|
commandArgumentSeparator: ' '
|
|
9
18
|
interactionCommand:
|
|
19
|
+
# enable interaction commands
|
|
10
20
|
enabled: true
|
|
21
|
+
# reply when an error occured
|
|
11
22
|
replyOnError: false
|
|
23
|
+
# register interaction commands on bot ready
|
|
12
24
|
registerCommands: true
|
|
25
|
+
# register commands to specific guild(s) empty to make it global
|
|
13
26
|
guilds: []
|
|
14
27
|
|
|
28
|
+
|
|
29
|
+
# Commands permissions
|
|
15
30
|
permissions:
|
|
16
31
|
messageCommands:
|
|
32
|
+
# enable command permissions
|
|
17
33
|
enabled: true
|
|
18
34
|
commands:
|
|
19
35
|
- command: 'stop'
|
|
20
36
|
permissions: ['ADMINISTRATOR']
|
|
21
37
|
interactionCommands:
|
|
38
|
+
# enable command permissions
|
|
22
39
|
enabled: true
|
|
23
40
|
commands:
|
|
24
41
|
- command: 'stop'
|
|
25
42
|
permissions: ['ADMINISTRATOR']
|
|
26
43
|
|
|
27
44
|
|
|
45
|
+
# Ignored channel IDs
|
|
28
46
|
ignoredChannels:
|
|
47
|
+
# enable ignored channels
|
|
29
48
|
enabled: false
|
|
49
|
+
# convert to only allowed channels
|
|
30
50
|
convertToAllowList: false
|
|
51
|
+
# channel IDs
|
|
31
52
|
channels: []
|
|
32
53
|
|
|
54
|
+
|
|
55
|
+
# Logger options
|
|
33
56
|
fileLogging:
|
|
57
|
+
# enable console output to file
|
|
34
58
|
enabled: true
|
|
59
|
+
# enable debug mode
|
|
35
60
|
debugmode: false
|
|
61
|
+
# stringify logged JSONs
|
|
36
62
|
stringifyLoggedJSON: false
|
|
63
|
+
# log file path
|
|
37
64
|
logFilePath: './logs/latest.log'
|
|
38
65
|
|
|
66
|
+
# Client options
|
|
39
67
|
client:
|
|
40
68
|
intents:
|
|
41
69
|
- 'GUILDS'
|
|
@@ -45,6 +73,7 @@ client:
|
|
|
45
73
|
- 'GUILD_MESSAGES'
|
|
46
74
|
- 'GUILD_MESSAGE_REACTIONS'
|
|
47
75
|
|
|
76
|
+
# Bot replies
|
|
48
77
|
messages:
|
|
49
78
|
notEnoughArguments: 'Not enough arguments.'
|
|
50
79
|
noPermissions:
|
|
@@ -54,6 +83,20 @@ messages:
|
|
|
54
83
|
content: 'An error occurred.'
|
|
55
84
|
ephemeral: true
|
|
56
85
|
|
|
86
|
+
|
|
87
|
+
###################################################
|
|
88
|
+
# #
|
|
89
|
+
# ##### ##### # # ### ##### #### #
|
|
90
|
+
# # # # # # # # # # # # #
|
|
91
|
+
# # # ##### # # # # ### ### #### #
|
|
92
|
+
# # # # # # # # # # # # #
|
|
93
|
+
# ### # # # # ### ##### # # #
|
|
94
|
+
# #
|
|
95
|
+
###################################################
|
|
96
|
+
## Modifying these values below can cause errors ##
|
|
97
|
+
|
|
98
|
+
# Modules folder
|
|
57
99
|
modulesFolder: 'modules'
|
|
58
100
|
|
|
59
|
-
version
|
|
101
|
+
# Current version
|
|
102
|
+
version: VERSION
|