Skip to content

v2.0.0

Compare
Choose a tag to compare
@gazmull gazmull released this 26 May 19:57
· 5 commits to stable since this release
7255fe7

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.

Added

  • (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 from array when using Embeds 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 via pageUpdate 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] ● ○
  • setAuthorizedUsers now accepts a user ID as well instead of just an array of user IDs.

Changed

  • ⚠ BREAKING - Embeds mode's changes to reflect Discord.JS' MessageEmbed methods:
    • Removed addBlankField
    • spliceField renamed to spliceFields
    • Added addFields
  • ⚠ BREAKING - Removed I prefix on the following TypeScript interfaces: INavigationEmojis, IClientAssets, IFunctionEmoji
  • ⚠ BREAKING - Renamed property pageIndicator to usePageIndicator
  • ⚠ 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.

Fixed

  • (@d-shaun) - Undesirable placement of start event's emission

Internal

  • (ft. @cycloptux) - Test script bot.js updated for new changes
  • Migrated linter from TSLint to ESLint
  • Upload vscode settings