fix: accept **kwargs in send_voice for Discord and Slack adapters
play_tts base class forwards metadata via **kwargs to send_voice, but Discord and Slack adapters did not accept extra keyword arguments, causing TypeError and silent message handling failure. Also fix test_web_defaults to patch correct env var (WEB_UI_TOKEN).
This commit is contained in:
@@ -609,7 +609,7 @@ class DiscordAdapter(BasePlatformAdapter):
|
||||
audio_path: str,
|
||||
caption: Optional[str] = None,
|
||||
reply_to: Optional[str] = None,
|
||||
metadata: Optional[Dict[str, Any]] = None,
|
||||
**kwargs,
|
||||
) -> SendResult:
|
||||
"""Send audio as a Discord file attachment."""
|
||||
try:
|
||||
|
||||
@@ -506,6 +506,7 @@ class SlackAdapter(BasePlatformAdapter):
|
||||
caption: Optional[str] = None,
|
||||
reply_to: Optional[str] = None,
|
||||
metadata: Optional[Dict[str, Any]] = None,
|
||||
**kwargs,
|
||||
) -> SendResult:
|
||||
"""Send an audio file to Slack."""
|
||||
try:
|
||||
|
||||
@@ -72,7 +72,7 @@ class TestConfigEnvOverrides(unittest.TestCase):
|
||||
|
||||
@patch.dict(os.environ, {
|
||||
"WEB_UI_ENABLED": "true",
|
||||
"WEB_TOKEN": "",
|
||||
"WEB_UI_TOKEN": "",
|
||||
}, clear=False)
|
||||
def test_web_defaults(self):
|
||||
config = GatewayConfig()
|
||||
|
||||
Reference in New Issue
Block a user