1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-01-10 09:20:28 +00:00

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

View File

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