Neues Plugin: Color HEX

This commit is contained in:
Akamaru 2017-06-26 15:58:48 +02:00
parent b22f6e0ba3
commit ebb702cefa

View File

@ -0,0 +1,26 @@
local color_hex = {}
function color_hex:init(config)
color_hex.triggers = utilities.triggers(self.info.username, config.cmd_pat):t('[Hh][Ee][Xx]', true).table
color_hex.doc = [[*
]]..config.cmd_pat..[[hex* _<Code>_: Sendet ein Beispielbild der Farbe]]
end
color_hex.command = 'hex <Code>'
function color_hex:action(msg, config, matches)
local input = utilities.input(msg.text)
if not input then
if msg.reply_to_message and msg.reply_to_message.text then
input = msg.reply_to_message.text
else
utilities.send_message(msg.chat.id, color_hex.doc, true, msg.message_id, true)
return
end
end
local img = 'https://www.beautycolorcode.com/'..input..'.png'
utilities.send_photo(msg.chat.id, img, nil, msg.message_id)
end
return color_hex