mirror of
https://github.com/Stone-Red-Code/EchoHub.git
synced 2026-09-06 07:46:19 +02:00
feat: add test sound command and enable notifications by default
This commit is contained in:
@@ -25,13 +25,29 @@ public class NotificationSoundService
|
||||
if (!_config.Enabled || _resolvedSoundPath is null)
|
||||
return;
|
||||
|
||||
await PlayInternal();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Plays the notification sound regardless of the Enabled setting (for /test-sound).
|
||||
/// </summary>
|
||||
public async Task PlayTestAsync()
|
||||
{
|
||||
if (_resolvedSoundPath is null)
|
||||
return;
|
||||
|
||||
await PlayInternal();
|
||||
}
|
||||
|
||||
private async Task PlayInternal()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (_player.Playing)
|
||||
await _player.Stop();
|
||||
|
||||
await _player.SetVolume(_config.Volume);
|
||||
await _player.Play(_resolvedSoundPath);
|
||||
await _player.Play(_resolvedSoundPath!);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user