flip_text hinzugefügt
This commit is contained in:
parent
d15a38daff
commit
bb87ad3dd5
28
miku/plugins/flip_text.lua
Normal file
28
miku/plugins/flip_text.lua
Normal file
@ -0,0 +1,28 @@
|
||||
-- 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
|
||||
utilities.send_reply(self, msg, 'Vergiss es!')
|
||||
return
|
||||
elseif command == 'flip' then
|
||||
new_text = run_command('flip "'..text..'"')
|
||||
elseif command == 'rev' then
|
||||
new_text = run_command('echo "' .. text .. '" | rev')
|
||||
end
|
||||
utilities.send_reply(self, msg, new_text)
|
||||
end
|
||||
|
||||
return flip
|
Reference in New Issue
Block a user