Skip to content

botify 1.6.2

Compare
Choose a tag to compare
@robinfriedli robinfriedli released this 15 Aug 01:04
· 374 commits to releases/v1.6 since this release

command parser, expand ClientQuestEvents, argument prefix, JDA 4

major new features

  • create CommandParser that enables escaping meta characters through
    an escape character "\" or using single or doubles quotes and makes
    using arguments smarter and less strict
    • inline arguments are now treated as regular arguments and can be
      used as such, when used as an inline character the value of the
      argument will be the input following the argument up to the next
      argument. The order in which inline arguments are used no longer
      matters. Meaning insert a $to b $at c could also be written
      insert a $at c $to b or even insert $to=b $at=c a.
    • argument values may now contain whitespace by putting the value in
      quotes like command $arg="some value"
    • enables using escape characters and quotes to escape meta characters
      e.g. play $spotify \$trackname or play $spotify "$trackname"
  • enable selecting several options comma separated when asked a question
  • add an option to select all options when asked a question by certain
    commands
  • add property to customise argument prefix
    • create CommandParseListener for the new CommandParser to update
      argument prefixes in existing Presets when changed
  • add monthly charts to charts command
  • help command examples now use the custom prefixes

other technical improvements

  • upgrade to JDA 4
  • refactor PlayableFactory to create Playables for Spotify albums and
    playlists and YouTube playlists when they appear in the provided list
    of objects for any method that returns a List of Playables
    • this was done to simplify #withUserResponse implementations if the
      user uses the new feature to select several options
  • create AudioManager#startPlayback and #startOrResumePlayback
    instead of relying on Playable#matches to automatically determine
    whether the current track is the track that should be played or if the
    skip or rewind commands / actions were used because in rare cases the
    Spotify id might be null in which case the method is unreliable
  • add Playable#getDisplayNow and #getDurationNow to use in queue view
    handler instead of using a timeout to further reduce loading time
  • make Playable methods throw an UnavailableResourceException instead of
    InterruptedException when trying to access a cancelled item because
    an InterruptedException does not quite make sense
  • make the the permission all attribute ignore admin commands
  • optimise ThreadExecutionQueue to synchronise #add and #runNext to make
    sure a thread can't be added at the same time as another one finishes
    and tries starting the next one, creating a window where potentially
    one thread to many could run at the same time
  • move GuildManager#getNameForGuild and #getPrefixToGuild to the
    GuildContext so the GuildContext
  • create AdditionalInformationException for exception classes that
    show addition hints, separating the long hint from the error message
  • create session in CommandListener to load bot name and prefix with
    instead of creating a session in both methods