Skip to content

Stable release v4.2.2

Latest
Compare
Choose a tag to compare
@JamesNZL JamesNZL released this 20 Nov 00:01

Changelog

1. Security Fixes

  1. Corrected implementation of developer-only commands
  2. Improved sensitives filter within !evaluate

2. Major Additions

  1. Added suite of lesson management commands and channels
    • Instructor Commands
      • !lesson view, !lesson add, !lesson remove, !lesson submit, !seen
    • Training Staff Commands
      • !assign, !approve
  2. Allow usage of @Pronto <command> in addition to existing prefix command syntax

3. Other

3.1. Additions

3.1.1. Dependencies

  1. chrono-node
  2. node-cron

3.1.2. Command Files

  1. commands\approve.js
  2. commands\assign.js
  3. commands\lesson.js
  4. commands\seen.js

3.1.3. Event Listeners

  1. Client#reaction
    • to manage submitted attendance registers using reactions

3.1.4. Handlers

  1. handlers.confirmation()
    • to handle reaction confirmation, using passed callback functions
  2. handlers.findLesson()
    • to find a mongoose Lesson document from the database
  3. handlers.lessonInstructions()
    • to send an instructional embed on Pronto's lesson management functionality
  4. handlers.lessonReminders()
    • to manage weekly lesson reminders on unsubmitted lessons
  5. handlers.manageAttendance()
    • to process emoji reactions on attendance registers
  6. handlers.unsubmittedLessons()
    • to process(/update) an embed displaying all current unsubmitted lessons
  7. handlers.updateUnsbmitted()
    • to act as a middleware between Client#messageReaction and handlers.unsubmittedLessons()
  8. Renamed handlers.indexProc() -> handlers.processIndex()

3.1.5. Modules

  1. modules.checkURL()
    • to validate whether a <string> is a URL
  2. modules.emojiReact()
    • to react to a message with a specified emoji
  3. modules.outputResources()
    • to output an array of submitted lesson resources
  4. modules.processResources()
    • to process input lesson resource(s)
  5. modules.promptEmbed()
    • to create an embed to prompt for user input
  6. modules.stripID()
    • to parse a User.id from a mention
  7. modules.titleCase()
    • to format a string in Title Case

3.1.6. mongoose Models

  1. Attendance
  2. Lesson

3.2. Commands and Handling

  1. Added a boolean showList to each command object, dictating whether to display that command in the guild's !help command list
  2. Edited messages now also trigger command execution within direct messages
  3. The msgCmd that is parsed to identify the bot command is now passed as the third argument into cmd.execute()
    • This is to allow for the suite of !lesson <subCommand> sub commands to act as aliases, such that !lesson add can beexecuted by !add
  4. Ensure edited messages are fetched prior to being passed to handlers.commandHandler()
  5. Execute !leavefor if the command message is erroneously !leave for
  6. Ensure command prefix is converted .toLowerCase() prior to any comparison operations
  7. Improved handling of member permissions in DMs
    • If a singular guild common guild can be identified, the GuildMember can be retrieved
    • Otherwise, return an error message and do not proceed with command execution

3.2.1. Attendance Registers

  1. Reformatted attendance registers
  2. Link to edited attendance register in update confirmation message
  3. Update attendance registers using emoji reactions, and remove !attendance update sub-command

3.2.2. !evaluate

  1. Added -nc and -s, and -delete & -del flags
  2. Stop bypassing evaluation of MessageEmbed object by default
  3. Added support for evaluation of code wrapped in a code block

3.3. mongoose

  1. Updated mongoose to v5.10.11
  2. Remove console outputs for mongoose#connected and mongoose#disconnected events

3.3.1. Database

  1. Ensure that uniqueKeys are initialised the first time handlers.updateCommands() is executed
    • i.e., ensure that they are initialised the first time, but not replaced on any future execution of handlers.updateCommands()

3.4. Setup of New Guilds

  1. handlers.newGuild() now supports custom parent channels, rather than only the #Pronto category channel
  2. Removed #example-text and #example-voice from bot configuration and handlers.newGuild()

3.5. Logging

  1. More comprehensive logging of member updates (such as roles and nicknames) using audit logs

3.6. Embed Formatting

  1. Ensure embed fields are not empty when using modules.charLimit()
  2. Add { dyanamic: true } option for avatars and icons, i.e. support animated images
  3. Include User.displayAvatarURL() in the footer of a command help embed
  4. Replace user mentions with GuildMember.displayName within embeds where appropriate
    • Ensure names render correctly in notifications, instead of their User.id wrapped in mention formatting

3.7. Other

  1. Reverted removal of the check to ensure defaultServer is a valid Guild.id on Client#ready
  2. Fixed the intended behaviour of modules.remove() to return the modified array, rather than the removed string
  3. Use a Set() within handlers.botPermsHandler() to ensure 'Permissions resolved' message is only sent once, and only when permissions have changed from false -> true
  4. Ensure Message has not been deleted before attempting to add a reaction using modules.errorReact() and modules.successReact()
  5. General improvements, refactoring, bug fixes, and optimisations