reciple 7.0.0-dev.11 → 7.0.0-dev.12

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.
Files changed (2) hide show
  1. package/README.md +45 -37
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -13,20 +13,20 @@
13
13
  <a href="https://www.codefactor.io/repository/github/falloutstudios/reciple/overview/main">
14
14
  <img src="https://www.codefactor.io/repository/github/falloutstudios/reciple/badge/main">
15
15
  </a>
16
-
17
- A simple Dicord.js handler that just works.
16
+ <br>
17
+ A simple Dicord.js handler that just works.
18
18
  </h3>
19
19
 
20
20
  # Features
21
21
 
22
- * [CLI based handler](#cli-usage)
23
- * [Supports Context Menus](#context-menus)
24
- * [Supports Prefix/Message commands](#message-commands)
25
- * [Validate messsage command options](#validate-message-command-options)
26
- * [Supports Slash Commands](#slash-commands)
27
- * [Built-in command cooldowns](#command-cooldowns)
28
- * Automatically register application commands
29
- * [Highly configurable](#config)
22
+ - [CLI based handler](#cli-usage)
23
+ - [Supports Context Menus](#context-menus)
24
+ - [Supports Prefix/Message commands](#message-commands)
25
+ - [Validate messsage command options](#validate-message-command-options)
26
+ - [Supports Slash Commands](#slash-commands)
27
+ - [Built-in command cooldowns](#command-cooldowns)
28
+ - Automatically register application commands
29
+ - [Highly configurable](#config)
30
30
 
31
31
  ## Installation
32
32
 
@@ -47,6 +47,7 @@ It will ask you to continue if the directory is not empty. Type `y` to continue.
47
47
  > You can change the token anytime you want
48
48
 
49
49
  ## CLI usage
50
+
50
51
  ```yml
51
52
  Usage: reciple [options] [cwd]
52
53
 
@@ -70,36 +71,38 @@ Options:
70
71
  Reciple provides built-in `MessageCommandBuilder` class that can be used for message command handler.
71
72
 
72
73
  ```js
73
- const { MessageCommandBuilder } = require('reciple');
74
+ const { MessageCommandBuilder } = require("reciple");
74
75
 
75
76
  new MessageCommandBuilder()
76
77
  .setName("command")
77
78
  .setDescription("Your lil tiny description")
78
- .addAliases('cmd', 'cmd1')
79
- .setExecute(command => command.message.reply("Hello!"))
79
+ .addAliases("cmd", "cmd1")
80
+ .setExecute((command) => command.message.reply("Hello!"));
80
81
  ```
81
82
 
82
83
  ### Validate Message Command Options
83
84
 
84
85
  ```js
85
- const { MessageCommandBuilder } = require('reciple');
86
+ const { MessageCommandBuilder } = require("reciple");
86
87
 
87
88
  new MessageCommandBuilder()
88
89
  .setName("command")
89
90
  .setDescription("Your lil tiny description")
90
- .addAliases('cmd', 'cmd1')
91
+ .addAliases("cmd", "cmd1")
91
92
  .setValidateOptions(true) // Validate options
92
- .addOption(option => option
93
- .setName("quantity")
94
- .setDescription("Must be a number")
95
- .setRequired(true) // A required option
96
- .setValidator(val => !isNaN(Number(val))) // Validate value
93
+ .addOption(
94
+ (option) =>
95
+ option
96
+ .setName("quantity")
97
+ .setDescription("Must be a number")
98
+ .setRequired(true) // A required option
99
+ .setValidator((val) => !isNaN(Number(val))) // Validate value
97
100
  )
98
- .setExecute(async command => {
99
- const quantity = Number(command.options.getValue('quantity', true));
101
+ .setExecute(async (command) => {
102
+ const quantity = Number(command.options.getValue("quantity", true));
100
103
 
101
104
  await command.message.reply("Quantity: " + quantity);
102
- })
105
+ });
103
106
  ```
104
107
 
105
108
  ## Context Menus
@@ -107,16 +110,16 @@ new MessageCommandBuilder()
107
110
  Reciple provides custom `ContextMenuBuilder` class that can be used for context menu command handler.
108
111
 
109
112
  ```js
110
- const { ContextMenuBuilder } = require('reciple');
111
- const { ApplicationCommandType } = require('discord.js');
113
+ const { ContextMenuBuilder } = require("reciple");
114
+ const { ApplicationCommandType } = require("discord.js");
112
115
 
113
116
  new ContextMenuBuilder()
114
- .setName('Ban')
117
+ .setName("Ban")
115
118
  .setType(ApplicationCommandType.User)
116
119
  .setExecute(async ({ interaction }) => {
117
120
  if (!interaction.inCachedGuild()) return;
118
121
  await interaction.member.ban();
119
- })
122
+ });
120
123
  ```
121
124
 
122
125
  ## Slash Commands
@@ -124,34 +127,38 @@ new ContextMenuBuilder()
124
127
  Reciple provides custom `SlashCommandBuilder` class that can be used for slash command handler.
125
128
 
126
129
  ```js
127
- const { SlashCommandBuilder } = require('reciple');
130
+ const { SlashCommandBuilder } = require("reciple");
128
131
 
129
132
  new SlashCommandBuilder()
130
- .setName('ping')
131
- .setDescription('Pong')
132
- .setExecute(async ({ interaction }) => interaction.reply(`Pong!`))
133
+ .setName("ping")
134
+ .setDescription("Pong")
135
+ .setExecute(async ({ interaction }) => interaction.reply(`Pong!`));
133
136
  ```
134
137
 
135
138
  ## Command Cooldowns
136
139
 
137
140
  ```js
138
- const { MessageCommandBuilder, MessageCommandBuilder, SlashCommandBuilder } = require('reciple');
139
- const { ApplicationCommandType } = require('discord.js');
141
+ const {
142
+ MessageCommandBuilder,
143
+ MessageCommandBuilder,
144
+ SlashCommandBuilder,
145
+ } = require("reciple");
146
+ const { ApplicationCommandType } = require("discord.js");
140
147
 
141
148
  new ContextMenuCommandBuilder()
142
- .setName('Context Menu')
149
+ .setName("Context Menu")
143
150
  .setType(ApplicationCommandType.Message)
144
151
  .setCooldown(1000 * 5) // 5 seconds cooldown
145
152
  .setExecute(async ({ interaction }) => interaction.reply(`Hello!`));
146
153
 
147
154
  new ContextMenuCommandBuilder()
148
- .setName('message-command')
155
+ .setName("message-command")
149
156
  .setDescription(`Your command`)
150
157
  .setCooldown(1000 * 5) // 5 seconds cooldown
151
158
  .setExecute(async ({ message }) => message.reply(`Hello!`));
152
159
 
153
160
  new SlashCommandBuilder()
154
- .setName('slash-command')
161
+ .setName("slash-command")
155
162
  .setDescription(`Your command`)
156
163
  .setCooldown(1000 * 5) // 5 seconds cooldown
157
164
  .setExecute(async ({ interaction }) => interaction.reply(`Hello!`));
@@ -187,7 +194,8 @@ Use env variable
187
194
  npx reciple --token "env:TOKEN_VARIABLE"
188
195
  ```
189
196
 
190
- ***
197
+ ---
191
198
 
192
199
  > ## Fun Fact
200
+ >
193
201
  > 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)
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "reciple",
3
3
  "description": "Reciple is a Discord.js handler",
4
4
  "license": "GPL-3.0",
5
- "version": "7.0.0-dev.11",
5
+ "version": "7.0.0-dev.12",
6
6
  "main": "./bin/index.js",
7
7
  "module": "./bin/esm.mjs",
8
8
  "types": "./bin/index.d.ts",
@@ -17,7 +17,7 @@
17
17
  "scripts": {
18
18
  "clean": "npx rimraf ./bin",
19
19
  "build": "npm run clean && npx tsc",
20
- "docs": "npx docgen -i ./bin/exports.d.ts -c ./docs/custom.json -o ./docs/docs.json --typescript"
20
+ "docs": "npx docgen -i ./src/exports.ts -c ./docs/custom.json -o ./docs/docs.json --typescript"
21
21
  },
22
22
  "files": [
23
23
  "bin",
@@ -27,7 +27,7 @@
27
27
  "dependencies": {
28
28
  "@inquirer/confirm": "^0.0.28-alpha.0",
29
29
  "@inquirer/password": "^0.0.28-alpha.0",
30
- "@reciple/client": "^7.0.0-dev.7",
30
+ "@reciple/client": "^7.0.0-dev.8",
31
31
  "chalk": "4.1.2",
32
32
  "commander": "^10.0.0",
33
33
  "dotenv": "^16.0.3",
@@ -43,5 +43,5 @@
43
43
  "peerDependencies": {
44
44
  "discord.js": "^14.7.1"
45
45
  },
46
- "gitHead": "6bb655c79d81bd02ae9fb2dc15d9741155e7484d"
46
+ "gitHead": "a0672211e2bf3af61fb69cc832f49338cd567f8d"
47
47
  }