discord.js-prompts
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -12,2 +12,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DiscordChannel = void 0; | ||
const MenuVisual_1 = require("./visuals/MenuVisual"); | ||
@@ -14,0 +15,0 @@ const MessageVisual_1 = require("./visuals/MessageVisual"); |
@@ -12,2 +12,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DiscordPrompt = void 0; | ||
const prompt_anything_1 = require("prompt-anything"); | ||
@@ -14,0 +15,0 @@ const events_1 = require("events"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DiscordPromptNode = void 0; | ||
const prompt_anything_1 = require("prompt-anything"); | ||
@@ -4,0 +5,0 @@ class DiscordPromptNode extends prompt_anything_1.PromptNode { |
@@ -12,2 +12,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DiscordPromptRunner = void 0; | ||
const prompt_anything_1 = require("prompt-anything"); | ||
@@ -14,0 +15,0 @@ const DiscordChannel_1 = require("./DiscordChannel"); |
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("prompt-anything")); | ||
__export(require("./DiscordChannel")); | ||
__export(require("./DiscordPromptRunner")); | ||
__export(require("./DiscordPrompt")); | ||
__export(require("./MenuEmbed")); | ||
__export(require("./visuals/MessageVisual")); | ||
__export(require("./visuals/MenuVisual")); | ||
__exportStar(require("prompt-anything"), exports); | ||
__exportStar(require("./DiscordChannel"), exports); | ||
__exportStar(require("./DiscordPromptRunner"), exports); | ||
__exportStar(require("./DiscordPrompt"), exports); | ||
__exportStar(require("./MenuEmbed"), exports); | ||
__exportStar(require("./visuals/MessageVisual"), exports); | ||
__exportStar(require("./visuals/MenuVisual"), exports); | ||
__exportStar(require("./types/DiscordPromptFunction"), exports); |
@@ -12,2 +12,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.MenuEmbed = void 0; | ||
const discord_js_1 = require("discord.js"); | ||
@@ -181,2 +182,8 @@ class MenuEmbed { | ||
try { | ||
/** | ||
* The message must be cached for it to be referenced | ||
* later by the reaction collector. This is required | ||
* if all messages are not cached by default. | ||
*/ | ||
message.channel.messages.cache.set(message.id, message); | ||
yield message.react('◀'); | ||
@@ -183,0 +190,0 @@ yield message.react('▶'); |
@@ -40,2 +40,7 @@ "use strict"; | ||
}, | ||
channel: { | ||
messages: { | ||
cache: new Map() | ||
} | ||
}, | ||
edit: jest.fn(), | ||
@@ -42,0 +47,0 @@ react: jest.fn(), |
@@ -356,3 +356,8 @@ "use strict"; | ||
const message = { | ||
react | ||
react, | ||
channel: { | ||
messages: { | ||
cache: new Map() | ||
} | ||
} | ||
}; | ||
@@ -373,3 +378,8 @@ yield menuEmbed.setUpPagination(message); | ||
const message = { | ||
react | ||
react, | ||
channel: { | ||
messages: { | ||
cache: new Map() | ||
} | ||
} | ||
}; | ||
@@ -379,2 +389,22 @@ yield menuEmbed.setUpPagination(message); | ||
})); | ||
it('adds the message to cache', () => __awaiter(void 0, void 0, void 0, function* () { | ||
menuEmbed.paginationErrorHandler = jest.fn(); | ||
jest.spyOn(menuEmbed, 'createReactionCollector') | ||
.mockReturnValue(); | ||
const react = jest.fn(); | ||
const set = jest.fn(); | ||
const message = { | ||
id: 'abc123', | ||
react, | ||
channel: { | ||
messages: { | ||
cache: { | ||
set | ||
} | ||
} | ||
} | ||
}; | ||
yield menuEmbed.setUpPagination(message); | ||
expect(set).toHaveBeenCalledWith(message.id, message); | ||
})); | ||
}); | ||
@@ -381,0 +411,0 @@ describe('createReactionCollector', () => { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.MenuVisual = void 0; | ||
class MenuVisual { | ||
@@ -4,0 +5,0 @@ constructor(menu, options) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.MessageVisual = void 0; | ||
class MessageVisual { | ||
@@ -4,0 +5,0 @@ constructor(text, options) { |
{ | ||
"name": "discord.js-prompts", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Create prompts in Discord, just like you would in console!", | ||
@@ -26,14 +26,14 @@ "main": "build/index.js", | ||
"discord.js": "^12.2.0", | ||
"prompt-anything": "^2.0.0" | ||
"prompt-anything": "^2.0.1" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^25.2.1", | ||
"@types/node": "^13.13.1", | ||
"@types/ws": "^7.2.4", | ||
"@typescript-eslint/eslint-plugin": "^2.29.0", | ||
"@typescript-eslint/parser": "^2.29.0", | ||
"@types/jest": "^25.2.3", | ||
"@types/node": "^13.13.10", | ||
"@types/ws": "^7.2.5", | ||
"@typescript-eslint/eslint-plugin": "^2.34.0", | ||
"@typescript-eslint/parser": "^2.34.0", | ||
"eslint": "^6.8.0", | ||
"jest": "^25.4.0", | ||
"ts-jest": "^25.4.0", | ||
"typescript": "^3.8.3" | ||
"jest": "^25.5.4", | ||
"ts-jest": "^25.5.1", | ||
"typescript": "^3.9.5" | ||
}, | ||
@@ -40,0 +40,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
109951
2546
Updatedprompt-anything@^2.0.1