Slash commands v1#8
Conversation
ec9661e to
5b1dd18
Compare
|
the /play SlashCommand should now be autocompleting results from YouTube when appropriate Theres also been some updates to the way the "Now Playing" message is displayed (when using /nowplaying or the old prefix command) I intend to preserve the prefix commands, but may disable them and put it behind some config setting (enablePrefixCommands) once the SlashCommand system is fleshed out. |
|
After some debugging, I noticed that the YoutubeAudioSource was always defaulting to use Android VR as its client. Because of that, I decided to limit the YoutubeAudioSource to use the AndroidVRWithThumbnail client. This provides better support for getting the thumbnail from youtube. This hasn't caused issues so far, but if it becomes a problem, I will revert it. YoutubeAudioSourceManager youtube = new YoutubeAudioSourceManager(
/*allowSearch:*/ true,
new Client[] {
new AndroidVrWithThumbnail()
}
); |
adccd67 to
f6ea711
Compare
f6ea711 to
5af0aa8
Compare
812caa1 to
8b22983
Compare
|
- introduced service-layer abstraction in `PlayerService`. - Introduced slash command `NowPlayingSlashCmd` for better interactivity. - Migrated existing command architecture into versioned packages (`v1`, `v2`). - Updated `pom.xml` to use version `0.5.2-beta-nowplayingcmd`. - Added support for button interactions in `Listener`.
…quotes if detected, improve skip/now-playing Button functionality
… and enhance repeat mode display
- Restart track if playing for more than 5 seconds. - Prevent duplicate tracks in queue. - Clear `previousTracks` on stop. - Ensure replacement tracks don't trigger queue logic.
- Add Mockito and JaCoCo dependencies for testing and coverage reporting. - Configure JaCoCo Maven plugin for test coverage generation. - Improve XML formatting for better readability.
- Introduced `maxHistorySize` in `BotConfig` for configurable history limit. - Added `HistoryQueue` to manage previously played tracks. - Implemented rewind functionality with optional queue adjustments. - Extended queue operations with methods like `addToHistory`, `clearAll`, and `removeLastPlayed`. - Removed unused `progressBar` method from `FormatUtil`.
…now-playing embed.
- Replace previous track handling with a new `HistoryQueue` implementation for better history tracking. - Update `AudioHandler` to utilize queue history instead of a separate list for previous tracks. - Enhance rewind functionality to check for available history and respond accordingly. - Set default maximum history size to 50 tracks.
…e test package structure
- Added tests for `AloneInVoiceHandler`, `AudioHandler`, `FormatUtil`, `HistoryQueue`, `LinearQueue`, `PlayerService`, and `Settings`. - Improved test coverage with edge cases and validation for core functionalities.
- Centralize logic for previous, shuffle, repeat, volume adjustment, skip, stop, and pause actions into `PlayerService`. - Improve code reusability and maintainability by introducing `OutputAdapter` for unified response handling. - Introduce support for `editNowPlaying` and `editNoMusic` methods to streamline message updates.
- Change logger variable to static in AudioHandler - Remove hardcoded maxSize for HistoryQueue - Add maxhistorysize to reference.conf (default config)
- Introduced the Maven Compiler Plugin (version 3.14.1) to set Java source and target versions to 17. - Extract property checks in Prompt class into a separate method, `isPropertyEnabled`, for better maintainability. This makes sure if -Dnogui is provided, it will not attempt to init the gui.
- Bump project version to 0.6.2-slash-commands in pom.xml. - Replace JUnit 4 `@Before` annotation with JUnit 5 `@BeforeEach` in TestBase class. - Remove deprecated Mockito dependency from pom.xml. - Move some tests around
- Introduced `SlashCommandRegistry` to handle the registration of slash commands with Discord, ensuring commands are only registered when they have changed. - Refactored `Listener` to register slash commands upon startup - Replaced deprecated button handling in `PlayerService` with JDA's native button components for improved interaction. - Added unit tests for `SlashCommandRegistry` to verify command registration logic and hash management.
- Introduced `MusicCommandValidator` to centralize validation logic for music commands, ensuring proper checks for text and slash commands. - Refactored `MusicCommand`, `PlayCmd`, and `MusicSlashCommand` to utilize the new validator, improving code maintainability and reducing duplication. - Added reusable output adapters for slash command responses to streamline message handling and error reporting. - Enhanced `PlaySlashCmd` with improved input handling and autocomplete functionality for better user experience.
- Replaced `PlayerService` with `MusicService` to centralize music operations, enhancing maintainability and clarity. - Introduced `SearchService` for handling search-related operations, improving separation of concerns. - Updated command classes to utilize the new `MusicService` and `SearchService`, ensuring consistent handling of music commands across text and slash commands. - Added reusable output adapters for better response management in both command types. - Removed deprecated `PlayerService` and refactored related tests to align with the new service structure.
- Updated README to note min Java version required - Java 25 - Introduced new slash command classes for admin functionalities, including `PrefixSlashCmd`, `QueuetypeSlashCmd`, and others, enhancing command management. - Refactored existing commands to utilize the new `MusicService` for improved functionality and consistency. - Added architectural documentation for better understanding of the system structure. - Enhanced the `run_jmusicbot.sh` script with JVM options for better compatibility with Java 22+.
…ion dependencies - Specified that glibc version must be 2.38 or higher for proper functionality. - Revised instructions for running the bot directly and clarified native library installation steps. - Enhanced documentation for Docker usage and configuration persistence.
ab03211 to
8a23b34
Compare
…r link - Corrected the link to the lavaplayer documentation for supported sources and formats.
|
superseded by #40 |
Refactor to decouple command behavior from the message-based interface.
implemented the first slash command /play
more to come soon, WIP