mcbot/cmds/dict.lua
changeset 16 064a50911e05
parent 2 c7ac7b6a76e0
child 42 99477d3c2dda
equal deleted inserted replaced
15:203b49c24dde 16:064a50911e05
     1 
     1 
     2 local function dict (args)
     2 local dict = { ["desc"] = "Dictionnary" }
       
     3 
       
     4 function dict.cmd (args)
     3     if not args then return nil, "Give me a word, please" end
     5     if not args then return nil, "Give me a word, please" end
     4     -- Be careful as we pass it as an argument to a shell command
     6     -- Be careful as we pass it as an argument to a shell command
     5     local word = string.match(args, "^(%w+)[%s%?%.%!]*$")
     7     local word = string.match(args, "^(%w+)[%s%?%.%!]*$")
     6     if not word then return nil, "Can you repeat please?" end
     8     if not word then return nil, "Can you repeat please?" end
     7 
     9