Commit Graph

633 Commits

Author SHA1 Message Date
Choco
47ec3d212a Refactor controller UI and bump version
Refactor interactive controller components and tweak command signatures.

- Make lyrics command accept keyword-only args (adds a leading * for title/artist).
- Bump version to v2.7.3b3.
- Import dispatch_message and add send_embed helper to ControlButton for embed responses.
- Introduce ControlSelect (base for selects) and refactor Tracks/Effects to inherit it, pass player explicitly and fix placeholder/player usage.
- Namespace localization keys (e.g. player.controls.forward/rewind) and defer interaction responses where appropriate.
- Replace direct send_localized_message calls with ControlSelect/ControlButton send wrappers to honor controller message settings.
- Add additional on_error handling for VoicelinkException and ensure non-ephemeral message deletion behavior follows controller settings.

These changes improve consistency for UI components, interaction handling, and localization usage.
2026-04-15 11:57:08 +08:00
Choco
629eb041f6 Use player.controls key for autoplay
Replace the 'autoplay' translation key with 'player.controls.autoplay' when sending the autoplay status message. Behavior is unchanged: the setting is toggled, a localized enabled/disabled message is sent, and do_next() is called if the player isn't playing.
2026-04-13 22:59:20 +08:00
Choco
ce6ef5d11e Defer interaction responses in commands
Call await ctx.defer() for discord.Interaction in play, search and playtop to avoid interaction timeouts during long operations. Also move the MongoDB get_user playlist fetch in check_playlist to after the defer so DB work doesn't occur before the interaction is deferred. (cogs/basic.py, cogs/playlist.py)
2026-04-05 23:55:50 +08:00
Choco
56a6b67470 Make messages ephemeral and bump discord.py
Make certain bot responses ephemeral to avoid spamming channels (debug command and missing-permission reply). Bump discord.py from 2.7.0 to 2.7.1 in requirements. Remove an unused Config().get_playlist_config() assignment in updatePlaylist to clean up dead code.
2026-03-30 11:01:53 +08:00
Choco
ae8dfbc1b6 Fixed translation to meet the discord requirements 2026-03-22 13:58:40 +08:00
Choco
8bb34326d1 Add settings reset command for per-setting defaults
Introduces a settings reset subcommand with choices so admins can clear one guild override at a time via MongoDB $unset, with live player sync for volume and duplicate-track defaults. Adds settings.actions.resetDone across language files and optional reset aliases (restore, defaults) in settings examples.
2026-03-22 12:09:34 +08:00
Choco
28cb2a910e Fix typo: max_playlists
Corrects the playlist settings key so it matches the code and config (max_playlists), avoiding mismatched or ignored limits when reading playlist settings.
2026-03-21 23:40:29 +08:00
Choco
19618a1726 Add per-player inactive cleanup timer and config
Adds configurable inactive cleanup timing and per-player timer logic so idle players disconnect or pause according to 24/7 and voice-channel state, replacing immediate teardown when the queue finishes.
2026-03-21 23:40:12 +08:00
Choco
3492846699 Use configured default playlist name
Set the new-user default playlist name from default_playlist_name in voicelink/config.py (fallback to Favourite) instead of hardcoding it.
2026-03-20 00:06:57 +08:00
Choco
88906b60ed Add channelId to voice state; upgrade discord.py for DAVE protocol
Include channelId in the voice session payload to ensure correct voice state. Upgrade discord.py from 2.6.4 to 2.7.0 to comply with Discord's DAVE protocol requirements.
2026-03-01 22:26:08 +08:00
Choco
dfa0616271 Fix playlist creation message key
Corrects the localization key from 'playlist.actions.create' to 'playlist.actions.created' when sending a message after playlist creation.
2026-01-06 10:56:11 +08:00
Choco
8fdceef4db Add user selection modal for playlist sharing
Introduces a modal dialog to select a user when sharing a playlist, improving the user experience. Updates the PlaylistView to use the new BaseModal for sharing, and enhances BaseModal to support select components and store their values.
2025-11-29 11:20:21 +08:00
Choco
9201ee730f fix: use correct disabled_vote key
Updated references to 'common.status.disabled_vote' to use 'disabled_vote' directly in the settings cog. This simplifies the settings structure and ensures consistency when toggling and displaying the voting system status.
2025-11-23 18:33:15 +08:00
Choco
d5186319a0 Add playlist permission management commands
Introduces a new 'permission' command to grant or revoke read, write, or remove permissions for playlists. Refactors playlist access checks to support granular permissions and shared playlist operations, and updates localized messages for permission actions.
2025-11-20 23:34:51 +08:00
Choco
e2ba8b472a Refactor message dispatch and playlist view error handling
Updated dispatch_message to use discord.utils.MISSING and improved content formatting. Added error handling in PlaylistView for VoicelinkException and refactored on_timeout logic in PlaylistViewManager to avoid duplication. Minor improvements to playlist track rendering.
2025-11-20 23:34:34 +08:00
Choco
e99aefefcf Handle MISSING sentinel in delete_after assignment 2025-10-30 18:33:27 +08:00
Choco
c1ad86563b Fix queue history display logic in QueueView
Updates the QueueView to pass 'not player.current' to player.queue.history(), ensuring the history is correctly reversed and displayed when not showing the current queue.
2025-10-09 11:12:29 +08:00
Choco
87f22b5589 Improve controller message handling and dispatch logic
Refactored Player.invoke_controller to combine controller setting and update checks, and added error handling for message deletion. Updated dispatch_message to use Optional types and MISSING for default values, improving clarity and handling of delete_after logic.
2025-10-09 11:12:17 +08:00
Choco
df5373353c Refactor track recommendation logic and add TrackRecType enum
Moved recommendation query generation from Node to Track using the new TrackRecType enum, simplifying and centralizing platform-specific recommendation formatting. Updated related methods to use Track.get_recommendations, removed Node.get_recommendations, and improved enum handling for search platform matching. Also exposed TrackRecType in voicelink.__init__.
2025-10-09 11:12:02 +08:00
Choco
c28f17ea43 Update playlist link validation and info text
Standardized playlist link validation messages across all language files and code, removing specific references to Spotify and YouTube. Updated README and help view to reflect broader platform support and clarified instructions. Removed unused YouTube regex and related thumbnail logic from objects.py.
2025-10-08 12:19:56 +08:00
Choco
7479f9bfe2 Show track length in autocomplete choices
Track autocomplete choices now display the formatted track length for both current tracks and history, improving user clarity when selecting tracks.
2025-10-08 12:19:40 +08:00
Choco
12be1ede64 Improve error logging in process_methods
Replaces traceback printing with structured logging using ipc_client._logger.error, providing better context and exception details when method processing fails.
2025-10-08 11:24:16 +08:00
Choco
7d8bec787c Refactor modals to use BaseModal and update node stats
Replaced custom ExecuteModal and AddNodeModal classes with a generic BaseModal for code execution and node creation. Updated Node class to initialize _stats attribute. Adjusted logic in NodesPanel to check for node stats before displaying memory info.
2025-10-06 16:10:53 +08:00
Choco
b503385542 Refactor modal usage and error handling in views
Replaced custom Modal class with BaseModal in embed_builder.py for consistency and maintainability. Updated modal instantiation to use custom_id and improved value handling. Removed redundant on_error methods from help.py, pagination.py, and search.py, and delegated error handling to superclass in controller.py for cleaner error management.
2025-10-06 15:56:30 +08:00
Choco
7f6135801d Add items property to Pagination and refactor QueueView
Introduced an 'items' property to the Pagination class for direct access to the underlying items list. Refactored QueueView to use this new property, improving code clarity and consistency.
2025-10-05 22:39:07 +08:00
Choco
5c98e60f91 Set default current view in DynamicViewManager
Initializes _current_view to the 'home' view if present, instead of None. Also removes unused BaseModal import and fixes type annotation for Pagination in QueueView.
2025-10-05 22:28:01 +08:00
Choco
df05a5b1bd Handle None prefix in get_prefix function
Ensures that get_prefix returns an empty string if the prefix is None, preventing potential issues with command parsing when no prefix is set in the settings.
2025-10-04 22:48:14 +08:00
Choco
8c68686497 Fix bot command not working in music request channel 2025-10-03 14:57:11 +08:00
Choco
90c2f22496 Fix music controller being removed after song playback 2025-10-03 14:56:30 +08:00
Choco
50298d2709 Resolve MongoDB handler not updating cache 2025-10-03 14:55:29 +08:00
Choco
81a8603e1d Added default language in language handler 2025-10-02 12:28:50 +08:00
Choco
8251e99dc4 Merge pull request #85 from ChocoMeow/refactor-views
Refactors the Voicelink module to centralize logic and enhance maintainability. Key changes include:
2025-10-02 12:10:09 +08:00
Choco
b6edd24171 Updated the language pack 2025-10-02 12:09:51 +08:00
Choco
de2a79ff93 Delete language.py 2025-10-02 00:21:35 +08:00
Choco
20df3703c3 Refactor localization keys 2025-10-02 00:10:25 +08:00
Choco
d439204146 Added get cached settings method in mongodbhandler 2025-10-02 00:06:09 +08:00
Choco
aee2ec5f3b fixed some bugs and remove presences intents 2025-10-02 00:05:26 +08:00
Choco
3831c87f9b Add default_search_platform option for customizable search platform 2025-09-29 21:15:23 +08:00
Choco
f6722e538a Moved ipc_client into voicelink 2025-09-29 19:54:51 +08:00
Choco
ef54f96f51 Migrate scripts to voicelink, rewrite handlers and views 2025-09-29 19:39:19 +08:00
Choco
7a4f85a74d Merge branch 'beta' into refactor-views 2025-09-26 13:29:27 +08:00
Choco
b0bf23ae2a Simplify bot prefix retrieval logic
Removed special handling for bot owner and access users in get_prefix. The function now always returns the configured prefix or the default.
2025-09-26 13:26:02 +08:00
Choco
44b4ba68d1 Fix language fallback logic in _get_lang function
Previously, _get_lang returned 'EN' if the language was not found, which could cause issues. Now, it sets lang to 'EN' and continues processing, ensuring consistent behavior.
2025-09-25 23:13:07 +08:00
Choco
2c98dfd763 Update command docstrings and localization keys
Improved docstrings for 'play' and 'search' commands in basic.py for clarity. Updated localization keys and translations in es-419.json, es-ES.json, and zh-CN.json to fix punctuation, naming consistency, and minor translation errors.
2025-09-24 17:58:15 +08:00
Choco
355d0e1186 Refactor language retrieval functions
Removed get_lang_non_async and replaced its usage with a new internal _get_lang function. Updated get_lang to use _get_lang for consistency. Updated Player class to use _get_lang directly, improving code clarity and reducing duplication.
2025-09-23 10:47:44 +08:00
Choco
0a7e9558b8 Merge pull request #82 from AheadAlot/main
Add Chinese simplified and traditional translations
2025-09-23 10:27:31 +08:00
Choco
7a2484265a Merge branch 'beta' into pr/82 2025-09-23 10:24:34 +08:00
Choco
eac92b9d73 Update zh-CN.json 2025-09-23 10:24:24 +08:00
TomStilson
c556f0fe7b Add Chinese simplified and traditional translations 2025-09-20 12:58:48 -04:00
Choco
9f43cce969 Merge branch 'beta' into refactor-views 2025-09-19 23:30:46 +08:00