afk plugin (not really) fixed

This commit is contained in:
Akamaru 2015-07-19 18:58:45 +02:00
parent efe6c82ddc
commit 22169266c0

View File

@ -1,17 +1,20 @@
function run(msg, matches) function run(msg, matches)
text = matches[2] --local text = matches[2]
local user_name = get_name(msg) local user_name = get_name(msg)
if matches[1] == '/afk' and not text then --[[if matches[1] == '/afk' and matches[2] then
return user_name .. ' ist nun AFK'
end
if matches[1] == '/afk' then
return user_name .. ' ist nun AFK (' .. text .. ')' return user_name .. ' ist nun AFK (' .. text .. ')'
else
return user_name .. ' ist nun AFK'
end]]
if string.starts(msg.text, '/afk') then
return user_name .. ' ist nun AFK'
--elseif string.starts(msg.text, '/afk') and text == not nil then
--return user_name .. ' ist nun AFK (' .. text .. ')'
end end
if matches[1] == '/re' or '/wd' then if string.starts(msg.text, '/re') or string.starts(msg.text, '/wd') then
return user_name .. ' ist wieder da!' return user_name .. ' ist wieder da!'
end end
@ -20,7 +23,7 @@ end
return { return {
description = 'Sagt dass ihr afk oder wieder da seid', description = 'Sagt dass ihr afk oder wieder da seid',
usage = {'/afk','/re','/wd'}, usage = {'/afk','/re','/wd'},
patterns = {'^/([A|a][F|f][K|k])$','^/([A|a][F|f][K|k]) (.*)$','^/([R|r][E|e])$','^/([W|w][D|d])$'}, patterns = {'^/[A|a][F|f][K|k]$','^/[A|a][F|f][K|k] (.*)$','^/[R|r][E|e]$','^/[W|w][D|d]$'},
run = run run = run
} }
--by Akamaru [https://ponywave.de] --by Akamaru [https://ponywave.de]