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-2/miku/plugins/notiz.lua
Andreas Bielawski 2c764ec818 Portiere "Notiz"
2016-08-24 22:42:05 +02:00

31 lines
883 B
Lua

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