166 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
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
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
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
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
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
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
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
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
f1fa4606ed Fix track existence check in Node.get_tracks
Corrects a variable name in the track existence check from 'track' to 'tracks', ensuring the method properly returns an empty list when no tracks are found.
2025-09-16 14:49:52 +08:00
Choco
5c973a76b9 Improve message handling and permission checks
Added a 'requires_fetch' parameter to the send function to ensure messages are fetched when needed. Enhanced command interaction checks to verify bot permissions for reading and sending messages in channels. Updated player controller logic to use the new fetch behavior for controller messages.
2025-08-24 22:47:52 +08:00
Choco
8edc26a6d0 Standardize permission and message keys in code and locales
Updated various permission and message keys in the codebase and all language files for consistency. Also added missing keys and fixed minor typos in several language files.
2025-08-10 12:44:05 +08:00
Choco
07b2576729 Fix send function context handling and queueType key
Updated the send function to correctly handle TempCtx and only include 'ephemeral' if supported by the send function. Also fixed the key from 'queue_type' to 'queueType' in the Player's IPC message for consistency with expected API.
2025-08-06 10:48:44 +08:00
Choco
e97a604aed Added silent mode to the controller 2025-08-04 11:07:59 +08:00
Choco
d9fb58ef92 Use snake_case for all database keys 2025-08-04 10:57:54 +08:00
Choco
c7d19b9383 Change variable name 2025-07-03 16:11:01 +08:00
Choco
026b262752 return empty list if track not found 2025-06-11 14:34:24 +08:00
Choco
8b81c05d98 Disable yt ratelimit if there are no tokens provided 2025-05-14 09:37:33 +08:00
Choco
47972a4eb5 Added peek next in loop type 2025-05-13 16:53:07 +08:00
Choco
2219820e55 Supported local languages in placeholder 2025-05-13 16:52:47 +08:00
Choco
ac56a22caa Updated the transformer 2025-04-17 12:17:10 +08:00
Choco
1b54e83cea Fixed some bugs 2025-04-10 11:37:14 +08:00
Choco
8007555759 Rewrite get_track function 2025-03-25 15:11:04 +08:00
Choco
461f1180b2 Fixed some bugs 2025-03-22 19:22:46 +08:00
Choco
5498c60466 Replaced internal spotify with lavalink 2025-03-22 18:42:28 +08:00
Choco
3a3675eb59 Reconnect the player after restarted 2025-03-07 17:20:57 +08:00
Choco
0ab2438abe Fixed typo 2025-03-07 14:24:52 +08:00
Choco
2c16543e0c Fixed track source 2025-03-04 12:01:37 +08:00
Choco
5b88f89894 Changed yt-ratelimit to optional 2025-02-26 16:17:55 +08:00
Choco
59034d8f5a Prevent usage of active token 2025-02-22 12:35:24 +08:00
Choco
f5af35a6a1 Added yt ratelimiter 2025-02-21 11:26:24 +08:00