Skip to content

Commit

Permalink
Fixes on Chuck Norris
Browse files Browse the repository at this point in the history
  • Loading branch information
yagop committed Jun 21, 2015
1 parent 608757a commit 852e242
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 36 deletions.
36 changes: 0 additions & 36 deletions chuck_norris.lua

This file was deleted.

21 changes: 21 additions & 0 deletions plugins/chuck_norris.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
local function chuck()
local random = http.request("http://api.icndb.com/jokes/random")
local decode = json:decode(random)
local joke = decode.value.joke
local unescape = (joke)
return unescape
end

local function run(msg)
local joke = chuck()
return URL.unescape(joke)
end

return {
description = "Get random Chuck Norris jokes.",
usage = "!chuck",
patterns = {
"^!chuck$"
},
run = run
}

0 comments on commit 852e242

Please sign in to comment.