@zoodogood/utils 1.2.6-change.1486 → 2.0.0-change.1496
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.
|
@@ -6,7 +6,7 @@ export type APIBaseButton = import("discord-api-types/v10").APIButtonComponentBa
|
|
|
6
6
|
*
|
|
7
7
|
* @param {Partial<APIBaseButton>[]} resolable
|
|
8
8
|
*/
|
|
9
|
-
export function justButtonComponents(resolable: Partial<import("discord-api-types/v10").APIButtonComponentBase<any>>[]): {
|
|
9
|
+
export function justButtonComponents(...resolable: Partial<import("discord-api-types/v10").APIButtonComponentBase<any>>[]): {
|
|
10
10
|
label?: string | undefined;
|
|
11
11
|
style: any;
|
|
12
12
|
emoji?: import("discord-api-types/v10").APIMessageComponentEmoji | undefined;
|
package/lib/discordjs/helpers.js
CHANGED
|
@@ -20,7 +20,7 @@ const DEFAULTS_FOR_BUTTON = {
|
|
|
20
20
|
*
|
|
21
21
|
* @param {Partial<APIBaseButton>[]} resolable
|
|
22
22
|
*/
|
|
23
|
-
function justButtonComponents(resolable) {
|
|
23
|
+
function justButtonComponents(...resolable) {
|
|
24
24
|
const buttons = resolable.map((data, i) => (Object.assign(Object.assign(Object.assign({}, DEFAULTS_FOR_BUTTON), { customId: `button.${i + 1}` }), data)));
|
|
25
25
|
return buttons;
|
|
26
26
|
}
|
|
@@ -42,7 +42,10 @@ function justSendMessage(target, options) {
|
|
|
42
42
|
if (options.reactions) {
|
|
43
43
|
options.reactions
|
|
44
44
|
.filter(Boolean)
|
|
45
|
-
.filter((react) =>
|
|
45
|
+
.filter((react) => {
|
|
46
|
+
var _a;
|
|
47
|
+
return !((_a = message.reactions) === null || _a === void 0 ? void 0 : _a.cache.some((compared) => compared.emoji.code === react));
|
|
48
|
+
})
|
|
46
49
|
.forEach((react) => message.react(react));
|
|
47
50
|
}
|
|
48
51
|
return message;
|