Skip to content

Slash commands v1#8

Closed
arif-banai wants to merge 24 commits into
masterfrom
slash-commands-v1
Closed

Slash commands v1#8
arif-banai wants to merge 24 commits into
masterfrom
slash-commands-v1

Conversation

@arif-banai

Copy link
Copy Markdown
Owner

Refactor to decouple command behavior from the message-based interface.

implemented the first slash command /play

more to come soon, WIP

@arif-banai arif-banai self-assigned this Dec 24, 2025
@arif-banai arif-banai added the enhancement New feature or request label Dec 24, 2025
@arif-banai arif-banai linked an issue Dec 25, 2025 that may be closed by this pull request
@arif-banai

Copy link
Copy Markdown
Owner Author

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.

@arif-banai

arif-banai commented Dec 28, 2025

Copy link
Copy Markdown
Owner Author

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.

in PlayerManager.java

YoutubeAudioSourceManager youtube = new YoutubeAudioSourceManager(
        /*allowSearch:*/ true,
        new Client[] {
                new AndroidVrWithThumbnail()
        }
);

@codecov-commenter

codecov-commenter commented Jan 23, 2026

Copy link
Copy Markdown

⚠️ JUnit XML file not found

The CLI was unable to find any JUnit XML files to upload.
For more help, visit our troubleshooting guide.

- 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
- 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`.
- 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.
- 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.
…r link

- Corrected the link to the lavaplayer documentation for supported sources and formats.
@arif-banai arif-banai closed this Jan 27, 2026
@arif-banai arif-banai deleted the slash-commands-v1 branch January 27, 2026 07:02
@arif-banai

Copy link
Copy Markdown
Owner Author

superseded by #40

@arif-banai arif-banai linked an issue Jan 27, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Slash Commands

2 participants