All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog.
2.1.0 - 2020-07-22
Embeds
mode:- Added
toJSON
method. setArray
method now accepts an array of embed data (plain object):<PaginationEmbed>.setArray([ { title: 'Yes', description: 'No' }, { title: 'No', description: 'Yes' }, ]);
- Added
2.0.0 - 2020-05-27
This version involves reflection of official release of Discord.JS 12, code optimisations, and changes that will give the user more control to the instance such as customisable page indicator, and favourable event emissions.
- (ft. @cycloptux) -
setPageIndicator
is now powerful for customisation.- First parameter has additional option
footer
(makes the indicator replace the embed's footer text instead).footer
option will not directly modify embeds fromarray
when usingEmbeds
mode.
- Second parameter has been added for indicator's formatting function: either use the following pre-made formats
'text' | 'textcompact' | 'circle' | 'hybrid'
— or make your own format. - In case you don't like the placing of the indicator (i.e. you want it in embed title instead), you can set the first parameter as false but set the second parameter to your preferred format and later on use the format by accessing getter
pageIndicator
then modify the embed viapageUpdate
event. - Example
-
<PaginationEmbed>.setPageIndicator('footer', (page, pages) => `peij ${page} 0f ${pages} - xoxo`)
- Pre-made formats preview:
- (default) text:
Page 1 of 2
- textcompact:
1/2
- circle:
● ○
- hybrid:
[1/2] ● ○
- (default) text:
-
- First parameter has additional option
setAuthorizedUsers
now accepts a user ID as well instead of just an array of user IDs.
- ⚠ BREAKING -
Embeds
mode's changes to reflect Discord.JS' MessageEmbed methods:- Removed
addBlankField
spliceField
renamed tospliceFields
- Added
addFields
- Removed
- ⚠ BREAKING - Removed
I
prefix on the following TypeScript interfaces:INavigationEmojis
,IClientAssets
,IFunctionEmoji
- ⚠ BREAKING - Renamed property
pageIndicator
tousePageIndicator
- ⚠ BREAKING - Navigation emoji identifiers (
BACK
,JUMP
,FORWARD
,DELETE
,ALL
) has been lowercased due to unnecessary internal transformations. usePageIndicator
's default is now set to false.- Event
pageUpdate
has been relocated to emit at initial page as well. - Events' JSDoc description has been improved.
- (@cycloptux) - Peer dependency Discord.JS version updated to
^12.0.0
- README's example has been updated to reduce complexity.
- (@d-shaun) - Undesirable placement of
start
event's emission
- (ft. @cycloptux) - Test script
bot.js
updated for new changes - Migrated linter from TSLint to ESLint
- Upload vscode settings
2.0.0-beta.4 - 2020-02-14
Utility has been updated to support the breaking change feature Managers
. Starting from this version it will no longer support the Discord.JS master commits earlier than bbdbc4c
.
2.0.0-beta.3 - 2020-01-21
attachFiles
method for Embeds modepageUpdate
event (emitted when the page number is updated via reaction)- Verbose documentation to
navigationEmojis
andfunctionEmojis
- Test script
bot.js
updated for new features
- Incorrect documentation examples for FieldsEmbed mode
- Fix
Unknown Message
error whendeleteOnTimeout
is enabled
2.0.0-beta.2 - 2019-11-12
- Embeds mode's
_loadList
overwriting existing message content
2.0.0-beta.1 - 2019-11-09
- Documentation example for IFunctionEmoji: stopping the instance from awaiting reacts with function emojis
- Documentation changes involving
page
andpages
properties
- Incorrect installation note on
UPDATING_V1.md
- FieldsEmbed mode's
_loadList
overwriting existing message content
2.0.0-beta.0 - 2019-07-29
Nothing new, but incremented version to make way for updated Discord.JS v11 variant release.
1.0.0 - 2019-07-29
Latest release for v11 branch. See changes below from 1.0.0-beta.0.
Master branch (For Discord.JS v12) has been incremented to 2.0.0-beta.0
1.0.0-beta.4 - 2019-04-26
Updating from v0.8.0
(Updated, please read again)
- Added ability to stop the instance from awaiting emoji reacts with function emojis:
<PaginationEmbed>.addFunctionEmoji('🛑', () => { // Either throw 'stopped'; // or return Promise.reject('stopped'); // will stop the instance from awaiting reacts. // Passing an error object will emit the `error` event. });
- Added
PaginationEmbed#setEmojisFunctionAfterNavigation
method. This allows function emojis to either be the first/last set to be deployed before/after navigation emojis.- Default:
false
.
- Default:
- PaginationEmbed no longer emits an event when there is no listener (invoking
.on
/.once
)
- Option
prepare
forclientAssets
has been removed. This affects:- Setting the
channel
property is a must now. (Used to be eitherclientAssets.message
orchannel
must be set)
- Setting the
- Fixed possibly unnecessary API call on awaiting emoji reacts timeout.
clientMessage#delete
now precedesclientMessage.reactions#removeAll
1.0.0-beta.3 - 2019-03-31
- More TypeScript notices
- Master branch (unreleased) installation
- Beautify bin output
- Unnecessary recasting of MessageEmbed on FieldsEmbed#_loadList
- Error handling
- Unnecessary re-setting clientAssets on
_verify()
1.0.0-beta.2 - 2019-03-27
Updating from v0.8.0
(Updated, please read again)
- Examples for README
-
Updated
UPDATING_V1.md
-
File structure: typings imports for TypeScript projects has been changed:
import Embeds from 'discord-paginationembed/typings/Embeds'; import FieldsEmbed from 'discord-paginationembed/typings/FieldsEmbed'; // Unlikely import { IClientAssets } from 'discord-paginationembed/typings/base';
import { Embeds, FieldsEmbed, IClientAssets } from 'discord-paginationembed';
-
showPageIndicator
➡setPageIndicator
- Non-working examples
- Page number that is out of bounds being ignored on
build()
- Missing message and channel objects being ignored
- Undefined array being ignored on
Embeds
mode methods
1.0.0-beta.1 - 2019-03-26
- New features testing for the test unit
Updating to v1
readme- Badges for README
- Gulp tasks
- Files structure
- Unnecessary NPM package assets being included on publish
- NPM tasks related to package building in favour of Gulp tasks
- Typings for events and superclass
- Superclass
EventEmitter
's methods/properties from docs (docs noises) start
event not being fired at all
1.0.0-beta.0 - 2019-03-25
If the link above is unavailable, you may proceed to the documentation site instead.
- NPM publish
- Package scripts and configs
- Changelog added
- PaginationEmbed events (from superclass
EventEmitter
) - Customisable
prompt
message (underclientAssets.prompt
)
MessageEmbed
superclass changed toEventEmitter
MessageEmbed
customisations forFieldsEmbed
mode can only be access viaembed
property. e.g:
<FieldsEmbed>.embed
.setColor('red')
.setTitle('A customised embed')
clientMessage
➡clientAssets
; including its method- Source code: from
JavaScript
toTypeScript
- Tweaked typings and documentation
README
revamped (please read)
- Dependencies-relevant:
yarn.lock
andeslint
-relevant - Object parameter to construct an instance. Please use the methods instead
- Current instance not being awaited properly on asynchronous functions. As example, your code that looks like this will work as expected now:
// e.g: A command has a cooldown/ratelimit for using this instance, we should wait for the instance to finish everything (either user deletes or expires the session) before we can let the user use this command again.
await <Embeds>.build();
return 'done!';
- Better typings and docs references
0.8.0 - 2019-03-12
- Added .catch() for clientMessage deletion (#23)
- Reflected MessageEmbed API (added SpliceFields, and setTimestamp now accepts a specified timestamp/date)
- Added declaration file for TypeScript users
- README has been cleaned up (removed v11 branch deprecation notice too)
- Documentation site changed from JSDoc to TypeDoc
- Use yarn command on package scripts (due to yarn.lock)
- Discord.JS stable compatibility (*-v11)
- Better array checking
- FieldsEmbed Mode no longer puts its pageIndicator on embed description, puts at the message content instead.
functionEmoji
- customised emojis with specific function (#8)deleteOnTimeout
- option to delete the message uponawaiting response
timeout (#11)test
folder forFieldsEmbed
andEmbeds
test bot
- Major documentation changes
authorizedUsers
is now anArray<User.id>
type (#9)Embeds
will now showclientMessage.content
afterpageIndicator
emojis
tonavigationEmojis
NavigationButtons
toNavigationEmojis
setEmojis
tosetNavigationEmojis
docs
folder; transferred togh-pages
branch
- Support for DMs (except for message/reaction deletes).
- Mention user on jump page prompt
- Original content not being kept when page indicator was not set to true
- JSDoc Typos
- Discord.JS stable compatibility (*-v11)
- Buttons still showing up even if the total pages are 1~2
0.2.1 - 2018-03-29
- Buttons being 'reacted' after navigation prompt (borderline API spam)
0.2.0 - 2018-03-09
authorisedUser
/setAuthorisedUser
➡️authorizedUser
/setAuthorizedUser
- First parameter on all methods are now required
- Every method that returns the current instance of
FieldsEmbed
/Embeds
class is now renamed toPaginationEmbed
to avoid inconsistency - Typedef tweak for
currentEmbed
andelementList
- Tweaked examples for consistency
- Discord.JS is now under
peerDependencies
instead ofdependencies
0.1.0 - 2018
- Initial release