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:
parent
f078cb4038
commit
1b10c3711d
3 changed files with 3 additions and 2 deletions
|
|
@ -609,7 +609,7 @@ class DiscordAdapter(BasePlatformAdapter):
|
||||||
audio_path: str,
|
audio_path: str,
|
||||||
caption: Optional[str] = None,
|
caption: Optional[str] = None,
|
||||||
reply_to: Optional[str] = None,
|
reply_to: Optional[str] = None,
|
||||||
metadata: Optional[Dict[str, Any]] = None,
|
**kwargs,
|
||||||
) -> SendResult:
|
) -> SendResult:
|
||||||
"""Send audio as a Discord file attachment."""
|
"""Send audio as a Discord file attachment."""
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
|
|
@ -506,6 +506,7 @@ class SlackAdapter(BasePlatformAdapter):
|
||||||
caption: Optional[str] = None,
|
caption: Optional[str] = None,
|
||||||
reply_to: Optional[str] = None,
|
reply_to: Optional[str] = None,
|
||||||
metadata: Optional[Dict[str, Any]] = None,
|
metadata: Optional[Dict[str, Any]] = None,
|
||||||
|
**kwargs,
|
||||||
) -> SendResult:
|
) -> SendResult:
|
||||||
"""Send an audio file to Slack."""
|
"""Send an audio file to Slack."""
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ class TestConfigEnvOverrides(unittest.TestCase):
|
||||||
|
|
||||||
@patch.dict(os.environ, {
|
@patch.dict(os.environ, {
|
||||||
"WEB_UI_ENABLED": "true",
|
"WEB_UI_ENABLED": "true",
|
||||||
"WEB_TOKEN": "",
|
"WEB_UI_TOKEN": "",
|
||||||
}, clear=False)
|
}, clear=False)
|
||||||
def test_web_defaults(self):
|
def test_web_defaults(self):
|
||||||
config = GatewayConfig()
|
config = GatewayConfig()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue