Portiere "Notiz"

This commit is contained in:
Andreas Bielawski 2016-08-24 22:42:05 +02:00
parent 0a6cc47379
commit 2c764ec818

31
miku/plugins/notiz.lua Normal file
View File

@ -0,0 +1,31 @@
local notiz = {}
local help_text
function notiz:init(config)
notiz.triggers = utilities.triggers(self.info.username, config.cmd_pat):t('note', true):t('notiz', true).table
notiz.doc = [[*
]]..config.cmd_pat..[[notiz* _<Text>_: Sendet eine Nachricht an dich selbst]]
end
function notiz:action(msg, config)
if msg.chat.type == 'private' then
utilities.send_reply(msg, 'Du solltest dieses Plugin nur in Gruppen nutzen!')
return
end
local input = utilities.input_from_msg(msg)
if not input then
utilities.send_reply(msg, notiz.doc, true)
return
end
local res = utilities.send_message(msg.from.id, input, true, nil, true)
if not res then
utilities.send_reply(msg, 'Bitte schreibe mir zuerst [privat](http://telegram.me/' .. self.info.username .. '?start=note)!', true)
else
utilities.send_reply(msg, 'Du hast eine PN ;)')
end
end
return notiz