new plugin sleep.lua
This commit is contained in:
parent
0406f6a994
commit
371c93b3d4
25
plugins/sleep.lua
Normal file
25
plugins/sleep.lua
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
require "socket"
|
||||||
|
|
||||||
|
local function sleep(sec)
|
||||||
|
socket.select(nil, nil, sec)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function run(msg, matches)
|
||||||
|
|
||||||
|
print('Schlafe... ')
|
||||||
|
|
||||||
|
-- Set delay in seconds (10 = 10 seconds)
|
||||||
|
local delay = 60
|
||||||
|
sleep(delay)
|
||||||
|
|
||||||
|
return 'Bin wieder da!'
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
description = "Setzt den Bot in schlaf",
|
||||||
|
usage = {"/sleep"},
|
||||||
|
patterns = {"^/[Ss][Ll][Ee][Ee][Pp]$"},
|
||||||
|
run = run
|
||||||
|
}
|
||||||
|
--by Akamaru [https://ponywave.de]
|
Reference in New Issue
Block a user