This repository has been archived on 2021-04-24. You can view files and clone it, but cannot push or open issues or pull requests.
Mikubot/plugins/sleep.lua

26 lines
452 B
Lua
Raw Normal View History

2015-08-17 02:30:34 +02:00
require "socket"
2015-11-27 22:11:13 +01:00
local function sleep(n)
os.execute("sleep " .. tonumber(n))
2015-08-17 02:30:34 +02:00
end
local function run(msg, matches)
print('Schlafe... ')
2015-11-27 22:11:13 +01:00
-- Delay in seconds (10 = 10 seconds)
local delay = matches[1]
2015-08-17 02:30:34 +02:00
sleep(delay)
return 'Bin wieder da!'
end
return {
description = "Setzt den Bot in schlaf",
usage = {"#sleep"},
patterns = {"^#[Ss][Ll][Ee][Ee][Pp] (.*)$"},
2015-11-27 22:11:13 +01:00
run = run,
privileged = true
2015-08-17 02:30:34 +02:00
}
--by Akamaru [https://ponywave.de]