Sleep gefixt

This commit is contained in:
Akamaru 2015-11-27 22:11:13 +01:00
parent 000186f6a7
commit 8eaa7c15f5

View File

@ -1,15 +1,15 @@
require "socket" require "socket"
local function sleep(sec) local function sleep(n)
socket.select(nil, nil, sec) os.execute("sleep " .. tonumber(n))
end end
local function run(msg, matches) local function run(msg, matches)
print('Schlafe... ') print('Schlafe... ')
-- Set delay in seconds (10 = 10 seconds) -- Delay in seconds (10 = 10 seconds)
local delay = 60 local delay = matches[1]
sleep(delay) sleep(delay)
return 'Bin wieder da!' return 'Bin wieder da!'
@ -19,7 +19,8 @@ end
return { return {
description = "Setzt den Bot in schlaf", description = "Setzt den Bot in schlaf",
usage = {"/sleep"}, usage = {"/sleep"},
patterns = {"^/[Ss][Ll][Ee][Ee][Pp]$"}, patterns = {"^/[Ss][Ll][Ee][Ee][Pp] (.*)$"},
run = run run = run,
privileged = true
} }
--by Akamaru [https://ponywave.de] --by Akamaru [https://ponywave.de]