reciple 1.4.1 → 1.4.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/README.md +6 -6
- package/bin/bin.js +8 -8
- package/bin/reciple/classes/Client.d.ts +2 -2
- package/bin/reciple/classes/Client.js +2 -2
- package/bin/reciple/classes/Config.js +2 -2
- package/bin/reciple/classes/builders/InteractionCommandBuilder.d.ts +1 -1
- package/bin/reciple/classes/builders/MessageCommandBuilder.d.ts +1 -1
- package/bin/reciple/commandPermissions.d.ts +2 -2
- package/bin/reciple/modules.d.ts +2 -2
- package/bin/reciple/registerInteractionCommands.d.ts +1 -1
- package/package.json +4 -4
- package/resource/reciple.yml +0 -3
package/README.md
CHANGED
|
@@ -19,12 +19,12 @@ npm i reciple
|
|
|
19
19
|
You can initialize the bot to the current directory with the following command:
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
reciple
|
|
22
|
+
npx reciple
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
It will ask you to continue if the directory is not empty type `y` to continue after the bot has been initialized it will ask you for your
|
|
25
|
+
It will ask you to continue if the directory is not empty type `y` to continue after the bot has been initialized it will ask you for your bot token.
|
|
26
26
|
|
|
27
|
-
> You can always change the token
|
|
27
|
+
> You can always change the token later
|
|
28
28
|
|
|
29
29
|
## Config
|
|
30
30
|
|
|
@@ -47,18 +47,18 @@ token: "env:TOKEN_VARIABLE"
|
|
|
47
47
|
You can override the token on the command line like so:
|
|
48
48
|
|
|
49
49
|
```bash
|
|
50
|
-
reciple --token "YOUR_TOKEN_HERE"
|
|
50
|
+
npx reciple --token "YOUR_TOKEN_HERE"
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
## Running the bot
|
|
54
54
|
To run the bot, run the following command:
|
|
55
55
|
|
|
56
56
|
```bash
|
|
57
|
-
reciple
|
|
57
|
+
npx reciple
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
> ## Fun Fact
|
|
61
|
-
> The name reciple is from a minecraft bug. The bug was a misspelling of the word `recipe`. [Mojang
|
|
61
|
+
> The name reciple is from a minecraft bug. The bug was a misspelling of the word `recipe`. [View Mojang Bug Report](https://bugs.mojang.com/browse/MC-225837)
|
|
62
62
|
|
|
63
63
|
# Save the Earth
|
|
64
64
|
[#letTheEarthBreathe](https://rebellion.global/)
|
package/bin/bin.js
CHANGED
|
@@ -9,32 +9,32 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
10
|
});
|
|
11
11
|
};
|
|
12
|
-
var _a;
|
|
12
|
+
var _a, _b;
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
const Config_1 = require("./reciple/classes/Config");
|
|
15
15
|
const Client_1 = require("./reciple/classes/Client");
|
|
16
16
|
const fs_1 = require("fs");
|
|
17
|
+
const version_1 = require("./reciple/version");
|
|
18
|
+
const flags_1 = require("./reciple/flags");
|
|
17
19
|
const fallout_utility_1 = require("fallout-utility");
|
|
18
20
|
require("dotenv/config");
|
|
19
|
-
const flags_1 = require("./reciple/flags");
|
|
20
|
-
const version_1 = require("./reciple/version");
|
|
21
21
|
if (flags_1.flags.version) {
|
|
22
22
|
console.log(`v${version_1.version}`);
|
|
23
23
|
process.exit(0);
|
|
24
24
|
}
|
|
25
25
|
const allowedFiles = ['node_modules', 'reciple.yml', 'package.json', 'package.lock.json', 'modules.yml', '.rmmcache'];
|
|
26
26
|
if ((0, fs_1.readdirSync)('./').filter(f => !f.startsWith('.') && allowedFiles.indexOf(f)).length > 0 && !(0, fs_1.existsSync)('./reciple.yml')) {
|
|
27
|
-
const ask = (0, fallout_utility_1.input)('This directory does not contain reciple.yml. Would you like to init axis here? [y/n] ');
|
|
28
|
-
if (ask !== 'y')
|
|
27
|
+
const ask = (_a = (0, fallout_utility_1.input)('This directory does not contain reciple.yml. Would you like to init axis here? [y/n] ')) !== null && _a !== void 0 ? _a : '';
|
|
28
|
+
if (ask.toString().toLowerCase() !== 'y')
|
|
29
29
|
process.exit(0);
|
|
30
30
|
}
|
|
31
|
-
const config = new Config_1.RecipleConfig((
|
|
31
|
+
const config = new Config_1.RecipleConfig((_b = flags_1.flags.config) !== null && _b !== void 0 ? _b : './reciple.yml').parseConfig().getConfig();
|
|
32
32
|
const client = new Client_1.RecipleClient(Object.assign({ config: config }, config.client));
|
|
33
33
|
(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
34
34
|
yield client.startModules();
|
|
35
35
|
client.on('ready', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
36
|
-
var
|
|
37
|
-
client.logger.warn(`Logged in as ${((
|
|
36
|
+
var _c;
|
|
37
|
+
client.logger.warn(`Logged in as ${((_c = client.user) === null || _c === void 0 ? void 0 : _c.tag) || 'Unknown'}!`);
|
|
38
38
|
yield client.loadModules();
|
|
39
39
|
client.addCommandListeners();
|
|
40
40
|
}));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ApplicationCommandDataResolvable, Awaitable, Client, ClientEvents, ClientOptions, Interaction, Message } from 'discord.js';
|
|
2
1
|
import { InteractionCommandBuilder, RecipleInteractionCommandExecute } from './builders/InteractionCommandBuilder';
|
|
3
|
-
import { recipleCommandBuilders, RecipleScript } from '../modules';
|
|
4
2
|
import { interactionCommandBuilders } from '../registerInteractionCommands';
|
|
5
3
|
import { MessageCommandBuilder, RecipleMessageCommandExecute } from './builders/MessageCommandBuilder';
|
|
6
4
|
import { Logger as LoggerConstructor } from 'fallout-utility';
|
|
7
5
|
import { Config } from './Config';
|
|
6
|
+
import { ApplicationCommandDataResolvable, Awaitable, Client, ClientEvents, ClientOptions, Interaction, Message } from 'discord.js';
|
|
7
|
+
import { recipleCommandBuilders, RecipleScript } from '../modules';
|
|
8
8
|
export interface RecipleClientOptions extends ClientOptions {
|
|
9
9
|
config: Config;
|
|
10
10
|
}
|
|
@@ -16,14 +16,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
16
16
|
};
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.RecipleClient = void 0;
|
|
19
|
-
const discord_js_1 = require("discord.js");
|
|
20
|
-
const modules_1 = require("../modules");
|
|
21
19
|
const registerInteractionCommands_1 = require("../registerInteractionCommands");
|
|
22
20
|
const fallout_utility_1 = require("fallout-utility");
|
|
23
21
|
const commandPermissions_1 = require("../commandPermissions");
|
|
24
22
|
const isIgnoredChannel_1 = require("../isIgnoredChannel");
|
|
25
23
|
const version_1 = require("../version");
|
|
26
24
|
const logger_1 = require("../logger");
|
|
25
|
+
const discord_js_1 = require("discord.js");
|
|
26
|
+
const modules_1 = require("../modules");
|
|
27
27
|
class RecipleClient extends discord_js_1.Client {
|
|
28
28
|
constructor(options) {
|
|
29
29
|
super(options);
|
|
@@ -4,12 +4,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.RecipleConfig = void 0;
|
|
7
|
-
const fallout_utility_1 = require("fallout-utility");
|
|
8
7
|
const fs_1 = require("fs");
|
|
8
|
+
const version_1 = require("../version");
|
|
9
|
+
const fallout_utility_1 = require("fallout-utility");
|
|
9
10
|
const flags_1 = require("../flags");
|
|
10
11
|
const path_1 = __importDefault(require("path"));
|
|
11
12
|
const yaml_1 = __importDefault(require("yaml"));
|
|
12
|
-
const version_1 = require("../version");
|
|
13
13
|
class RecipleConfig {
|
|
14
14
|
constructor(configPath) {
|
|
15
15
|
this.configPath = './reciple.yml';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SlashCommandBuilder } from '@discordjs/builders';
|
|
2
1
|
import { CommandInteraction, PermissionFlags, PermissionString } from 'discord.js';
|
|
2
|
+
import { SlashCommandBuilder } from '@discordjs/builders';
|
|
3
3
|
import { RecipleClient } from '../Client';
|
|
4
4
|
export interface RecipleInteractionCommandExecute {
|
|
5
5
|
interaction: CommandInteraction;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { MessageCommandOptionBuilder } from './MessageCommandOptionBuilder';
|
|
1
2
|
import { Message, PermissionFlags, PermissionString } from 'discord.js';
|
|
2
3
|
import { Command } from 'fallout-utility';
|
|
3
4
|
import { RecipleClient } from '../Client';
|
|
4
|
-
import { MessageCommandOptionBuilder } from './MessageCommandOptionBuilder';
|
|
5
5
|
export declare type CommandMessage = Command;
|
|
6
6
|
export interface RecipleMessageCommandExecute {
|
|
7
7
|
message: Message;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Permissions } from
|
|
2
|
-
import { Config } from "./classes/Config";
|
|
1
|
+
import { Permissions } from 'discord.js';
|
|
3
2
|
import { recipleCommandBuilders } from './modules';
|
|
3
|
+
import { Config } from './classes/Config';
|
|
4
4
|
export declare function commandPermissions(commandName: string, memberPermissions?: Permissions, configConmmandPermissions?: Config['permissions']['messageCommands'] | Config['permissions']['interactionCommands'], builder?: recipleCommandBuilders): boolean;
|
package/bin/reciple/modules.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { RecipleClient } from './classes/Client';
|
|
2
|
-
import { MessageCommandBuilder, RecipleMessageCommandExecute } from './classes/builders/MessageCommandBuilder';
|
|
3
1
|
import { InteractionCommandBuilder, RecipleInteractionCommandExecute } from './classes/builders/InteractionCommandBuilder';
|
|
2
|
+
import { MessageCommandBuilder, RecipleMessageCommandExecute } from './classes/builders/MessageCommandBuilder';
|
|
3
|
+
import { RecipleClient } from './classes/Client';
|
|
4
4
|
export declare type recipleCommandBuilders = MessageCommandBuilder | InteractionCommandBuilder;
|
|
5
5
|
export declare type recipleCommandBuildersExecute = RecipleInteractionCommandExecute | RecipleMessageCommandExecute;
|
|
6
6
|
export declare type loadedModules = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InteractionCommandBuilder } from './classes/builders/InteractionCommandBuilder';
|
|
2
|
-
import { RecipleClient } from "./classes/Client";
|
|
3
2
|
import { ApplicationCommandDataResolvable } from 'discord.js';
|
|
3
|
+
import { RecipleClient } from './classes/Client';
|
|
4
4
|
import { ContextMenuCommandBuilder, SlashCommandBuilder, SlashCommandSubcommandBuilder, SlashCommandOptionsOnlyBuilder, SlashCommandSubcommandGroupBuilder, SlashCommandSubcommandsOnlyBuilder } from '@discordjs/builders';
|
|
5
5
|
export declare type interactionCommandBuilders = InteractionCommandBuilder | ContextMenuCommandBuilder | SlashCommandBuilder | SlashCommandSubcommandBuilder | SlashCommandOptionsOnlyBuilder | SlashCommandSubcommandGroupBuilder | SlashCommandSubcommandsOnlyBuilder;
|
|
6
6
|
export declare function registerInteractionCommands(client: RecipleClient, cmds?: (interactionCommandBuilders | ApplicationCommandDataResolvable)[], overwriteGuilds?: string | string[]): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reciple",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"description": "A Discord.js bot",
|
|
5
5
|
"author": "FalloutStudios",
|
|
6
6
|
"license": "GPL-3.0",
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
],
|
|
18
18
|
"scripts": {
|
|
19
19
|
"clean": "rimraf bin",
|
|
20
|
-
"compile": "yarn clean && tsc",
|
|
20
|
+
"compile": "yarn clean && npx tsc",
|
|
21
21
|
"build": "yarn compile && npm un reciple -g && npm i ./ -g",
|
|
22
22
|
"build:publish": "yarn run build && yarn run changelog && yarn publish",
|
|
23
|
-
"test": "cd test && reciple",
|
|
23
|
+
"test": "cd test && npx reciple",
|
|
24
24
|
"test:build": "yarn run build && yarn test:run"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"commander": "^9.3.0",
|
|
28
|
-
"discord.js": "^13.8.
|
|
28
|
+
"discord.js": "^13.8.1",
|
|
29
29
|
"dotenv": "^16.0.1",
|
|
30
30
|
"fallout-utility": "^1.3.14",
|
|
31
31
|
"semver": "^7.3.7",
|