aiode
-
botify 1.6
Published by robinfriedli over 5 years ago
rework of the code base, guild properties, admin commands, spotify URIs
New features
-
add a whole new category of commands: admin commands
- these commands provide core functionality like restarting, updating
and quitting the bot with an added bonus that if the bot is shut
down that way it will wait for pending commands and rest actions to
complete
-
add adjustable guild properties for deeper customisation
- properties are guild specific settings persisted as columns on the
GuildSpecification and have a default value
- they can currently be used to change the colour scheme and toggle
"Now playing..." messages
- the bot name and prefix were also implemented as properties
-
add support for Spotify URIs
- added a class that recognises and parses Spotify URIs and creates
playables based on the URI's type (currently track, playlist and
album)
Large user orientated improvements and changes
- rework Permission command and add more arguments to manage several
commands at once
- create SecurityManager and apply command permissions to widget actions
- redesign the queue widget using emojis to display the enabled options
instead of creating a field for each option
- add enabled options to the footer of the "Now playing..." messages
- fix widgets throwing an exception when attempting to skip or rewind
when the queue is empty
- handle this in the widgets and improve the exception thrown by the
AudioQueue
- redesign help command to be more compact
- rework the behavior of the "own" keyword
- make it work with albums
- still use a regular spotify query and then filter the results using
the SpotifyApi#checkUsersSavedTracks method instead of loading
all of the users tracks and then filtering the results
- this means the spotify query syntax can now be used with this
argument
- remove PendingQuestionRemovalInterceptor
- ClientQuestionEvents are no longer removed when entering a different
command
Large changes to the code base
- create Botify as a statically available class that provides access
to all of Botify's managers and add core functionality like shutting
down or restarting the bot
- create Cache class to aid reflective instantiation of classes and
provide cached instances for constructor parameters
- replaces the ParameterContainer
- migrate GuildSpecifications to the db
- this servers as a preparation for moving the bot to sharding some
day
- add Current class to CommandContext to enable static access to the
current thread's CommandContext
- create StaticSessionProvider to provide hibernate sessions based
on whether a CommandContext is set up
Other changes and improvements
- rework Widgets and create AbstractWidgetAction class that also manages
permissions required to use a specific widget action
- create QueueIterator to better manage iterating the queue
- use this class as the AudioEventAdapter for the respective
playback instead of using AudioManager for everything
- this class in instantiated for each AudioPlayback each time a
playback is started and replaced when a different playback is
started. This improves handling when the queue is iterating in a
loop over unplayable tracks
- limit the amount of invalid tracks skipped automatically to avoid
a frozen queue, spamming the chat or even a stack overflow
- add id to playable and use this id when creating a playback history
to prepare for the charts command
- rework CommandInterceptors and create CommandInterceptorChain
- use Sets instead of Lists for relations on hibernate entities
- LoginCommand: check if the user actually received the message and
make the corresponding method in the MessageService return the
message
- cancel login refresh tasks when a login is destroyed by a logout
- add a timout function when waiting for values of a playable that is
currently being loaded
- implemented for Playable#getDisplay and Playable#getDurationMs
- this speeds up loading the queue view page when the queue is
currently being loaded, displaying playables that aren't done yet
as "Loading..."
- create PlayableFactory and move away the createPlayable methods from
the AudioManager
- create GuildTrackLoadingExecutor and move loading tracks away from
the AudioPlayback class
- delete PlayableImpl and split it up into the TrackWrapper for Spotify
track previews and make the YouTubeVideo interface extend Playable
- create SpotifyService and phase out SearchEngine, using it only for
local playlists
- remove DiscordListener and split it into several different listeners
- move adding the annotated classes to the hibernate configuration file
and use a more recent method to build the SessionFactory that supports
this
- create AbstractQueueLoadingCommand as a super class for the play
and queue commands to merge their similar code
- remove channel parameter from AbstractCommand#sendMessage and the
user parameter form AbstractCommand#runWithLogin as they were always
getContext.getChannel() or getContext.getUser()
- split up AlertEventListener into several interceptors, one for each
entity, create a super class for this kind of interceptor and create
a new interceptor that alerts changes to the access configuration
- create and export command: check if the playlist count and size
properties are empty
- MessageService: make common timeout errors when sending messages take
up less space in the logs
- replace old java.util.Date with java.time.LocalDateTime
- HttpHandlers: add some utility methods to handle parameters and errors
- update guava and lava player