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/flip_text.lua

28 lines
686 B
Lua
Raw Normal View History

2016-08-16 13:57:33 +02:00
-- Requires: (sudo) npm install -g flip-text
local flip = {}
function flip:init(config)
flip.triggers = {
"^/(flip) (.+)$",
"^/(rev) (.+)$"
}
flip.doc = '*/flip* _<Text>_: Dreht Text auf den Kopf\n*/rev* _<Text>_ Dreht Text um'
end
flip.command = 'flip <Text>'
function flip:action(msg, config, matches)
local command = matches[1]
local text = matches[2]
if text:match('"') then
2016-08-24 17:18:17 +02:00
utilities.send_reply(msg, 'Vergiss es!')
2016-08-16 13:57:33 +02:00
return
elseif command == 'flip' then
new_text = run_command('flip "'..text..'"')
elseif command == 'rev' then
new_text = run_command('echo "' .. text .. '" | rev')
end
2016-08-24 17:18:17 +02:00
utilities.send_reply(msg, new_text)
2016-08-16 13:57:33 +02:00
end
return flip