Improve error when no path is passed to "speaker"

Co-authored-by: Matthew W <fatboychummy@gmail.com>
This commit is contained in:
Jonathan Coates 2024-03-24 11:10:36 +00:00
parent 777aa34bb0
commit ae767eb5be
No known key found for this signature in database
GPG Key ID: B9E431FF07C98D06
1 changed files with 4 additions and 0 deletions

View File

@ -43,6 +43,10 @@ if cmd == "stop" then
for _, speaker in pairs(get_speakers(name)) do speaker.stop() end
elseif cmd == "play" then
local _, file, name = ...
if not file then
error("Usage: speaker play <file or url> [speaker]", 0)
end
local speaker = get_speakers(name)[1]
local handle, err