local pasteee = {}
function pasteee:init(config)
if not cred_data.pasteee_key then
print('Fehlender Key: pasteee_key.')
print('pasteee.lua wird nicht aktiviert, listquotes won\'t be available.')
return
end
pasteee.triggers = {
"^/pasteee (.*)$"
}
pasteee.doc = [[*
]]..config.cmd_pat..[[pasteee* _<Text>_: Postet Text auf Paste.ee]]
pasteee.command = 'pasteee <Text>'
local key = cred_data.pasteee_key
function upload(text, noraw)
local url = "https://paste.ee/api"
local pet = post_petition(url, 'key='..key..'&paste='..text..'&format=json')
if pet.status ~= 'success' then return 'Ein Fehler ist aufgetreten: '..pet.error, true end
if noraw then
return pet.paste.link
else
return pet.paste.raw
function pasteee:action(msg, config, matches)
local text = matches[1]
local link, iserror = upload(text)
if iserror then
utilities.send_reply(self, msg, link)
utilities.send_reply(self, msg, '[Text auf Paste.ee ansehen]('..link..')', true)
return pasteee