Skip to content

v1.6.2

Compare
Choose a tag to compare
@naeruru naeruru released this 08 Jun 20:06
· 12 commits to master since this release
f80df00

see README.md for setup details. this update is backwards compatible besides an npm install. no changes need to be done for it to work as is. (^. ̫ .^) *:・゚☆

HOWEVER, this version is a preliminary restructure to the code. so, if your version of my code changes manageBoard() in index.js in any way, read the restructure section below!

There are also changes from v1.6.1 that were never documented in a release

Features

  • adds ability for a user to edit their message after their message is pinned to the board, up to a configurable amount
    • you can configure the grace period in the config with editMsgGracePeriod, where 1 = 1 second. The grace period is calculated based on when the original message from the user is posted, not when the message is reposted on the board. If editMsgGracePeriod is 0 or null (missing), this feature is disabled.

Fixes

  • fix gif url favoriting issue where favoriting a gif would redirect to my placeholder url. now, favoriting a gif redirects to the FIRST url of the embed. sadly the star button for favoriting gifs will always redirect to the overall url of the embed, so this does not fix the issue with multiple gifs still redirecting to the first gif of the embed. this is just how discord handles embeds, but I will keep an eye on this to make updates accordingly.

Examples

click here for example of editing a message after it has been posted
234446637-54686fb3-9606-4c5a-931b-ff58751f6261.mp4

Restructure

I've split the main logic (manageBoard()) into three functions. this improves its ability to reuse code for future additions (such as adding commands, file splitting, etc). I decided to hold off on slash commands for now since it would be a pretty big change and I think it is good idea to have a version before that that is fully backwards compatible with everything. plus I want more time to work out the right way to go forward so that I keep the code simple and don't add bloat at all. functions:

  • manageBoard()
    • entry point for managing the starboard. same as before, it determines if a message should be posted, edited, or ignored
  • buildEmbedFields()
    • manages the logic for building embeds. takes a reaction structure and builds a json object data that contains all fields needed for an embed.
  • editEmbed()
    • logic for editing an embed. takes an optional forceUpdate param. If forceUpdate is true, starboard will update the description, images, and footer of the embed. if forceUpdate is false, it will act as it did before and only update the footer.