Releases: robinfriedli/aiode
botify 1.6.1
charts command, additional properties and several bug fixes and improvements
- added charts command
- added properties to select the default source (Spotify, YouTube, local) when searching a track or list
- added property to toggle the auto pause feature
- fixed behaviour when skipping a paused track that just resumed the track without skipping
- made adding playlist items in the correct order more reliable when adding tracks from different sources at the same time
- fixed issue when rolling back invalid property values where the wrong value would stay cached and break the property
- added proper ehcaching and made sure GuildSpecification entities are operated upon in the same session that created them
- added caching for AudioTracks that resulted when loading a Playable using soft references
- fixed error when playing cached AudioTracks by always cloning them beforehand
- fixed error handling in MessageService causing additional errors when trying so send the error as an EmbeddedMessage with missing permissions to do so
botify 1.6
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
- these commands provide core functionality like restarting, updating
-
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
- properties are guild specific settings persisted as columns on the
-
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)
- added a class that recognises and parses Spotify URIs and creates
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
- handle this in the widgets and improve the exception thrown by the
- 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
- this means the spotify query syntax can now be used with this
- remove PendingQuestionRemovalInterceptor
- ClientQuestionEvents are no longer removed when entering a different
command
- ClientQuestionEvents are no longer removed when entering a different
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
- this servers as a preparation for moving the bot to sharding some
- 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
- use this class as the AudioEventAdapter for the respective
- 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
botify 1.5.2
move and insert commands, ThreadExecutionQueue, Playlist indices etc.
- create move and insert commands to move items within playlists.
- to enable this playlist items are no longer sorted by create
timestamp across the tables but by the new item_index column - a startup task has been created to migrate the existing playlists
- a listener verifies and sets the item_index values for newly
created or altered playlists
- to enable this playlist items are no longer sorted by create
- the CommandManager now always searches for commands and presets
- previously it only searched for presets if no command was found,
meaning if you had a preset that starts with a command name
(e.g. "playlist") it would not find the preset- if it finds both it takes the longest match, when both are
exactly the same it favours the command over the preset
- if it finds both it takes the longest match, when both are
- previously it only searched for presets if no command was found,
- create ThreadExecutionQueue and CommandExecutionThread to manage
how many commands can run concurrently per queue- All commands are now run as a CommandExecutionThread, meaning the
CommandContext is easily accessible from everywhere during the
command runtime. This fixes an issue where the wrong or no message
channel was passed to the exception handler for track loading
threads.
- All commands are now run as a CommandExecutionThread, meaning the
- the Youtube redirect for Spotify tracks no longer just takes the best
match according to YouTube but analyses the three best matches,
checking whether the channel name contains the artist and comparing
levenshtein distances - "Could not load track messages" now delete each other like the
"No playing" messages to prevent spam and it ignores if repeat all
is enabled to prevent infinite spam - create NoSpotifyResultsFoundException that adds a hint about how to
use Spotify queries to the message when no spotify tracks were found - raised the bot name limit for the rename command from 10 to 20
- AbstractWidget now saves the guildId as a field since message#getGuild
could cause garbage collection issues- this fixes a problem where older widgets could not be deleted
- AbstractWidget no longer adds a delay when adding reactions, deletes
old widget instead- the delay was added to avoid problems with the rate limiter when
adding reactions to the new widget while removing them from the old
one; now the old widget just gets deleted
- the delay was added to avoid problems with the rate limiter when
- the CommandVerificationInterceptor no longer allows the command input
to be longer than 1000 characters - verify playlist names and correct them if they have more than one
space consecutively- Discord would omit the unnecessary spaces when displaying the name,
causing confusion
- Discord would omit the unnecessary spaces when displaying the name,
- create PersistTask class to create tasks that are used in several
locations- e.g. HibernatePlaylistMigrator and UpdatePlaylistItemIndicesTask
- adjust the add command to be extendable by the insert class, so only
the few things that are actually different about the command had to
be overwritten - add method to AbstractCommand to only split a part of the command body
by an argument - CommandContext now has a UUID that is added to error messages to help
finding them in the log - add a new method for each event to the ChainableInterceptor that gets
called by the regular method which handles all thrown exceptions and
calls the next interceptor in the chain without having to do so
explicitly in the Interceptor implementation - add a shared invoker for all guilds in case the mode is not
partitioned- since, when mode == SHARED, all guilds access the same playlists
they should all be synchronised
- since, when mode == SHARED, all guilds access the same playlists
- PlaylistItems are no longer added to the respective collection on the
playlist in the constructor but manually when calling the new add()
method- this allows the insert command to check if the playlist is empty
when the items have already been created but not yet added
- this allows the insert command to check if the playlist is empty
- log all exceptions thrown in httpHandlers
botify 1.5.1.2
fix presets containing a single quote
botify 1.5.1.1
make preset search case insensitive & bug fixes
- presets are now recognised disregarding their capitalization when
entered - fix commands not being parsed correctly due to case sensitivity
- fix bug in search command when searching for Spotify
albums / playlists with less than 5 tracks - correct some typos
- no longer alert name change on startup
botify 1.5.1
command presets, volume command, customisable command prefix etc.
- add command preset feature
- Command presets can be used as shortcuts for lengthy commands or
creating an alias for a command. Presets han hold one variable
marked by "%s" that may be assigned a value when using
the preset.
- Command presets can be used as shortcuts for lengthy commands or
- add volume command to change the music volume
- add customisable command prefixes to start commands separate from
the bot name - update notifications now show new features
- send a getting started message when a new guild joins
- add examples section to help command
- fix an issue where playlist tracks do not get played in the correct
order - fix an issue where the search command fails when displaying a short
local playlist - the "Now playing..." widget now shows the next track considering the
repeat settings - the queue command now shows the playback settings even when the queue
is empty - automatically unpause playback when playing a different track
- make CommandExecutor a CommandInterceptor and have one separate
synchronised Invoker per guild - refactor AudioQueue
- create Table2 class to help create a table in an EmbedMessage
botify 1.5.0.1
1.5 hotifx and several technical improvements
- the permission command no longer requires input, so that flag had to
be changed - handle unavailable YouTube videos when attempting to load their
duration- contentDetails is null for unavailable videos, just return 0 instead
- synchronise the CommandExecutor#invoke method on the guild that calls
it- making sure the same guild can not run this method concurrently.
This is to counteract the spamming of a command that uses this
method, e.g. spamming the add command concurrently could evade
the playlist size limit.
- making sure the same guild can not run this method concurrently.
- auto reformat all code in the project
- MessageService: do not log the stack trace for warnings when a
message could not be sent because of permissions- this just spams the logs adding no value
botify 1.5
introduce widgets, add new "reverse" and "forward" commands,
support Spotify query syntax and other major changes
- introduce widgets. A widget is an interactive message that can be
interacted with by adding reactions. Different reactions trigger
different actions that are represented by the reaction's emote.
They can be used to create a simple player UI. - support the Spotify query syntax to filter results when searching
for Spotify tracks.- The "artist:" and "album:" filters can be used as such:
$botify play from the inside artist:linkin park album:meteora
- The "artist:" and "album:" filters can be used as such:
- "Now playing..." messages have been redesigned and are now widgets
that can pause / unpause the playback and skip / rewind tracks - The queue display is now also a widget with controls to:
- enable / disable shuffle, repeat one and repeat all
- play / pause the queue
- skip / rewind tracks
- add "forward" and "reverse" commands to change the position of
the current track- Skip or rewind the given amount of seconds or minutes in the current
track.
E.g. $botify forward 110
$botify reverse $minutes 2
- Skip or rewind the given amount of seconds or minutes in the current
- delete old "Now playing..." messages when a new one is sent so the
channel does not get spammed. - check if input is a URL before checking arguments for several commands
- the arguments $spotify, $list and $youtube are intended to tell the
bot where to search for the entered search query, yet some users
use, for example, the $youtube argument when entering a YouTube
URL, in which case it would search for a video with the URL as name,
finding nothing. Now the bot first checks whether the input is a
URL, ignoring arguments if that's the case.
- the arguments $spotify, $list and $youtube are intended to tell the
- update permission command with the option to show a list off all
commands and who can access them. - update and improve some command descriptions explaining better how to
use them. - add support for the discordbots.gg API to update the bots statistics.
- recognise youtu.be URLs as YouTube URLs and treat them accordingly.
- handle throwables returned by lava player when loading tracks and
print them to the channel. - style success and error messages.
- some command outputs (e.g. queue, local list search and client question)
are now lists rather than tables with several embedded fields, because
the content of one row was often too long, meaning all columns could
not fit next to each other, resulting in the columns being aligned
vertically. - All InvalidCommandExceptions now add a hint to use the help command.
- updated SearchEngine
- get rid of the MAX_REQUESTS property and load everything until
there is no page left.
- get rid of the MAX_REQUESTS property and load everything until
- minor refactor for AlertService (renamed to MessageService).
- all methods now return a CompletableFuture for the Message they
are sending, since the completed Message objects are used by the
widgets.
- all methods now return a CompletableFuture for the Message they
- add C3P0 connection pool configuration instead of using hibernate's,
which is marked unsuitable for productive systems. - CommandExecutor#invoke is no longer synchronised, since it is no
longer required.- when pk's were not generated with strategy GenerationType.IDENTITY
there could be an issue when creating entities concurrently, but
since that is no longer the case running the invoke method
synchronised is pointless.
- when pk's were not generated with strategy GenerationType.IDENTITY
- update readme.
botify 1.4.2
add clear command and various bug fixes and improvements
- add clear command that clears the current queue of all tracks
(except the currently playing track) - update dependencies
- fix YouTubeService#getAllVideos method not loading video IDs
- help command: ensure correct order of commands by using a
LinkedHashMultimap - improve some command descriptions to better explain what they do
- AlertService: add stack trace to one warning
botify 1.4.1.1
handle insufficient permissions when sending message to guild