Releases: svioletg/lydian
Release list
v0.10.0
Overview
Breaking changes
- The debug console command
readhas been renamed toeval
- YouTube text search is now supported
- Configure how many results to choose from are shown with the
max_search_resultsconfig key
- Configure how many results to choose from are shown with the
- Config key
media_filter.allowed_urlsis nowmedia_filter.allowed_queries - Tracks can now be looped via the
-loopcommand - You can now have the bot prompt for confirmation when using
-removeby setting the
confirm_on_removeconfig key totrue
Added
- Added bot command
-loop(methodcogs.voice.VoiceCog.toggle_loop()) (#34) - Added debug bot command
-buttons - Added config key
confirm_on_remove(bool)- If
true, using-removewill prompt the user to confirm their choice
- If
- Added config key
max_search_results(#39) - Added
titlenamed group to markdown header regexes inconstconst.MD_HEADER_REGEXconst.MD_H1_REGEXconst.MD_H2_REGEXconst.MD_H3_REGEX
- Added tool module
tools.testdataytdl - Added enum member
const.EmojiStr.LOOP(#34) - Added enum member
const.EmojiStr.LOOP_ONE(#34) - Added attribute
cogs.voice.MediaItem.uploader - Added attribute
cogs.voice.VoiceCog.loop(#34) - Added class
cogs.util.DynamicButtonsView - Added constant
const.EMOJI_DIGITS - Added constant
const.HTTP_REGEX - Added constant
const.YTDL_SEARCH_PREFIX_REGEX(#39) - Added classmethod
const.EmojiStr.from_int() - Added parameter
confirm_callbackto methodcogs.voice.MediaItem.from_url()- Takes a function which receives the tuple of constructed
MediaItemobjects and must return
Truefor the method to return those objects, returning an empty tuple ifFalse
- Takes a function which receives the tuple of constructed
- Added method
cogs.voice.VoiceCog.loop_state_embed()(#34) - Added method
cogs.voice.VoiceCog._prompt_media_item_choice()(#39) - Added function
util.group_by() - Added function
util.nop()- "No-op"; takes any arguments and keyword arguments and does nothing
- Added function
util.nop_ret()- Returns a function with takes any arguments and keyword arguments and returns a specified value
util.nop_trueandutil.nop_falsealso added for convenience which returnTrueandFalse
respectively
- Added mock function
tests.conftest.mock_ytdl() - Added proper handling for
discord.ext.commands.errors.BadLiteralArgumentin
bot.on_command_error()
Changed
- Renamed config key
media_filter.allowed_queries - Renamed console command
debug readtodebug eval - Renamed attribute
config.MediaFilterConfig.allowed_urlsto.allowed_queries - Renamed method
console.LydianConsole.debug_read()to.debug_eval() - Renamed method
config.Config.filter_media_url()to.filter_query_url() - Renamed function
util.assure()toasserts() util.asserts()now raises the builtinAssertionErrorinstead of the now-removed custom
exceptionerrors.AssuranceError- Method
cogs.util.DropdownView.__init__()parameteroptionsnow acceptsIterableinstead of
justlist util.Cacheobjects can now be effectively disabled with theenabledattribute, which prevents
setting keys and retrieving keys from its data dictionary- Multiple methods in
MediaItemnow use.get(...) or ...instead of setting a default for
.get()in yt-dlp extracted info dictionary usage - Method
cogs.voice.VoiceCog.play()now takes a variable argumentquery_partsinstead ofurl
(#39)- This allows queries with spaces to be used as one whole string
- Attribute
cogs.voice.VoiceCog._play_callsnow requires a third item for its tuples: either
'url'or'search'(#39) - Method
cogs.voice.VoiceCog._try_to_queue()now takes an optionalchooseparameter (#39)- Prompts the user to choose one track to queue out of the extracted items
- Various messages that mention a URL in queueing now mention "query" since searching is supported
(#39)
Removed
- Removed class
tests.ReadOnlyDict - Removed exception
errors.AssuranceError - Removed exception
tests.ReadOnlyModifiedError - Removed function
tests._raise_for_readonly()
Fixed
- Fixed markdown header regexes matching more header symbols than intended, they now correctly match
only their respective header level - Fixed
check_for_stable_onlyconfig key not getting checked when checking updates at bot startup
(#42)
v0.9.1
This release is intended to replace the now-yanked v0.9.0, which due to improper merging did not contain any of the intended changes.
Overview
- Vote-skipping is now supported, optionally requiring a minimum number of users (a percentage of
the channel or an exact count) to use-skipbefore the current track is skipped. (#16)- To use it, add the
[vote_skipping]table to yourlydian-config.tomllike below and adjust
the values as desired.
- To use it, add the
[vote_skipping]
enabled = true
threshold_type = "percentage"
percentage = 50
literal = 3Added
- Added debug console command
debug store - Added debug bot command
-dropdown(methodcogs.debug.DebugCog.dropdown()) - Added module
help - Added constant
const.DOCSTRING_PARAM_REGEX - Added constants
const.GH_CHANGELOG_WEBandconst.GH_CHANGELOG_RAW - Added constants to
const:MD_HEADER_REGEXMD_H1_REGEXMD_H2_REGEXMD_H3_REGEX
- Added enum members
const.EmojiStr.BACKandconst.EmojiStr.GEAR - Added classes
cogs.util.ArrowButtonsViewandcogs.util.DropdownView - Added class
cogs.voice.VoteSkip - Added attribute
cogs.voice.MediaItem.user_idto replace.user - Added method
console.LydianConsole._debug_evaluate_in_context() - Added functions to
cogs.util:cog_emoji()command_signature()paginated_message()
- Added functions to
util:cog_commands()getclass()get_text_sections()mention()
- Added pytest fixtures
mock_botandmock_discord_user
Changed
util.dirsize()now only counts file sizes and ignores directoriescogs.voice.MediaItemobjects now store who queued the item as theirintuser ID rather than
the actualdiscord.Memberobject, which allows them to be deep-copied- Moved
update.GH_API_ROOT,update.GH_REPO_API_ROOT, andupdate.USER_AGENTtoconst- Value of
USER_AGENTupdated to use the package's name instead oflydian-update-checker
- Value of
- Swapped arguments of
util.first_where()to make the predicate first, matching built-ins like
mapandfilter
Removed
- Removed attribute
cogs.voice.MediaItem.user, (replaced by.user_id)
Fixed
- Fixed
cogs.voice.MediaItemobjects always refreshing when advancing queue if their
thumbnail_urlattribute is truthy (incorrectly wrote
(not item.duration) or (item.thumbnail_url)instead of
(not item.duration) or (not item.thumbnail_url)) - Fixed
ZoneInfonot working correctly on systems without an IANA database by includingtzdata
as a dependency
v0.8.0
Overview
Breaking changes:
- Some TOML configuration keys are now properly nullable, using the
'n/a'value to indicate
such.- Config keys
max_duration,media_dir_warn_threshold,inactivity_timeout, and
lonely_timeoutnow use'n/a'instead of-1or0to indicate they should be disabled
- Config keys
- Lydian can now optionally check for new releases at startup, toggled with the
check_for_updates
configuration key (orLYDIAN_CHECK_UPDATESenvironment variable).- You can check for updates manually by running
lydian-update. - By default, pre-releases are skipped during this check. Set the
check_for_stable_onlyconfig
key tofalseto include pre-releases.
- You can check for updates manually by running
- The media queue now has a shuffle mode, use
-shuffle <on|off>to enable or disable it. - Lydian now includes exception arguments in "unexpected error" messages.
- Full tracebacks are still only available in Lydian's logs.
- A temporary (deletes after 10 seconds) message is now sent when skipping a track
Added
- Added config key
bot_console(boolean)- env:
LYDIAN_BOT_CONSOLE
- env:
- Added config key
check_for_updates(boolean)- env:
LYDIAN_CHECK_UPDATES
- env:
- Added config key
check_for_stable_only(boolean)- env:
LYDIAN_CHECK_STABLE_ONLY
- env:
- Added console commands
versionandupdates - Added module
update - Added debug bot commands
-argstrand-argint - Added bot commands:
-issues-repo-shuffle
- Added attribute
cogs.voice.VoiceCog.shuffle - Added attributes
converter_envandconverter_tomltoconfig.ConfigFieldMeta - Added command methods
cogs.debug.DebugCog.argstr()andcogs.debug.DebugCog.argint() - Added command methods
cogs.general.GeneralCog.repo()andcogs.general.GeneralCog.issues() - Added command method
cogs.voice.VoiceCog.toggle_shuffle() - Added method
console.LydianConsole.version() - Added classmethod
tools.todos.Todo.parse_todos()- Parses
Todoobjects directly from a string without needing file paths
- Parses
- Added method
tools.todos.Todo.with_file() - Added function
util.exc_str()
Changed
- Package version is now set dynamically using
__version__from__init__.py - Bot command
-hellonow accepts aliases - The discord.py exceptions
BadArgumentandMissingRequiredArgumentare now properly handled - Logging methods in
cogs.voice.YTDLLogHandlernow log withdepth=2for more accuracy - Renamed in
const:COLOR_INFO→EMBED_COLOR_INFOCOLOR_OK→EMBED_COLOR_OKCOLOR_WARN→EMBED_COLOR_WARNCOLOR_ERROR→EMBED_COLOR_ERROR
- A status message is now sent when retrieving info for a track before downloading begins (#30)
- Tool
todosnow accepts multiple directories to search - In
tools.todos:Todo.contentis now an attribute and not a methodTodo.headeris now a cached property and no longer accepted as a constructor argumentTodo.fileis now an optional attributefind_todos()now takes a variable positional argumentpathsinstead of the single
positional argumentsource_dir, stillstr | Path
- Moved function
config.env_to_bool()toutil.FromStr.to_bool() - Renamed classmethod
util.FromStr.filesize()toutil.FromStr.to_filesize() - Unexpected errors caught in
bot.on_command_errornow have their exception args sent along with
the bot's message instead of only saying to check the logs
Fixed
v0.7.0
Overview
Breaking changes:
- TOML configuration keys now use underscores (
_) instead of hyphens (-) - Config key
log_levelunderloggingis nowlevel
- [feature] A duration limit for media items can now be set using the
max-durationconfig key, which
specifies the limit in seconds using a positive integer (setting to 0 will disable the limit)max-duration-allow-unknownspecifies whether tracks with an unknown duration can be played
or not when a duration limit is in place, defaulting tofalse- If no limit is set, this key is unused and tracks of unknown duration are always allowed
- To save time on queueing, Lydian does not fetch a track's duration until it needs to, meaning
items queued from a playlist URL won't have their duration checked against the limit until
they are next in line
- [feature]
lydiancan now be run with the-Vor--versionoption to display the installed Lydian
version and exit without starting the bot - [feature] The "now playing" view now shows the approximate current timestamp of the playing media
(#13)- Slight network delays will likely cause this number to be slightly inaccurate, but it should
remain close enough for reference
- Slight network delays will likely cause this number to be slightly inaccurate, but it should
- [fix] Fixed filesize strings in the config with single digits raising an error due to a typo in the
regex used to match them
Added
- Added the
-V/--versionoption to thelydianpackage command- When used, Lydian's version is printed out and the script immediately exits
- Added config key
max-duration(integer) - Added config key
max-duration-allow-unknown(boolean) - Added class
config.Config.ConfigField - Added class
config.Config.ConfigFieldMeta - Added method
config.Config.set() - Added property
config.Config.fields - Added function
util.compose() - Added support for validator functions in
config.Configfields, which can be given with the
'validators'key of a given field'smetadataargument as a single function or iterable of
functions
Changed
- Having debug mode enabled no longer forces the log level to "DEBUG" level
cogs.voice.MediaItem.duration_strnow returns?:??for an unknown duration instead ofNonecogs.voice.MediaItem.embed()now accepts an optionaltimestampkeyword argument to show the
current time alongside its duration- TOML configuration keys are now in
snake_caseinstead ofkebab-case; though the latter is more
common in TOML, it's ultimately unnecessary to keep converting keys between the two cases where
needed const.LogLevelis now anIntEnumsubclass instead ofStrEnumconfig.Configupdating and loading from TOML is now handled in the class itself in a simpler
fashion than usingutil.DataclassUpdateMixin(#26)
Removed
- Removed mixin class
util.DataclassUpdateMixin- Only used for updating the configuration object, which now handles updating in its own class
Fixed
- Fixed single-digit filesize numbers in TOML config not matching pattern
- Queue no longer stops when encountering an error, will now skip problematic items until one can be
played or the queue is empty (#25)
v0.6.1
v0.6.0
This is the first public pre-release version for Lydian.
Lydian is currently in a beta state, before its v1.0.0 release it may be unstable or subject to a number of bugs. Pre-releases should work reasonably well, but it should likely be kept to smaller servers for the time being. Below is a basic user-facing overview of Lydian's current commands and features; more detail can be found in Lydian's full changelog, and a longer overview of the project and how to use the bot is at the README.
General features
- Can keep a queue up to a user-defined limit (or no limit) of tracks to play
- Supports any source URL that yt-dlp supports: https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md
- Can queue full playlists/albums from URLs (this can be limited or disabled)
- Filters can be set for URLs or yt-dlp extractor names to control what is allowed to play: https://github.com/svioletg/lydian-discord-bot#url-and-extractor-filtering
- Has role-based permissions to control who can use which commands
Bot commands
"Author" or "command author" refers to the user issuing the command.
Arguments surrounded by angle brackets (<>) are required, while arguments in square brackets ([]) are optional. Brackets should not be included in the actual argument values.
-join
Joins the author's voice channel if they are connected to one, leaving the voice channel it was previously in if applicable. Typically unnecessary to use, as -play will make the bot do this automatically if not connected already.
-leave
Leaves the voice channel the bot is connected to, if any. The user issuing this command must be in the same voice channel as the bot.
-play
If not given a URL, tries to resume a paused or stopped player. Otherwise, the URL is added to the bot's queue, playing immediately if the queue was previously empty.
-pause
Pauses the player. Can be resumed with -play.
-stop
Stops the player. This behaves like most media players do, meaning the currently playing track is saved and will be played from the beginning of -play is used again after stopping.
-skip
Skips the currently item (whether playing, paused, or stopped), starting the next item in the queue if one exists.
-nowplaying
Shows what's currently playing.
-queue [page]
Shows the queue. If the queue is longer than 20 items, it will be separated into pages, where a specific page can be viewed with -queue 2, -queue 3, etc.
-remove <index>
Removes an item at the index position of the queue.
-move <from> <to>
Moves an item from position from of the queue to position to.
-clear
Removes every item from the queue, leaving it empty.
-help
Shows a list of every command available and a brief description of it. This is very bare at the moment, and will be much more user-friendly in the future (#18).