From b95afbb819602c8c6074dfd043c38205a923cd7a Mon Sep 17 00:00:00 2001 From: Akamaru Date: Mon, 13 Jul 2015 23:00:24 +0200 Subject: [PATCH] link as pattern in urban_dictionary.lua --- plugins/urban_dictionary.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/urban_dictionary.lua b/plugins/urban_dictionary.lua index 62e0d85..4e779ba 100644 --- a/plugins/urban_dictionary.lua +++ b/plugins/urban_dictionary.lua @@ -1,5 +1,5 @@ function getUrbanDictionary(text) - local topic = string.match(text, "/ud (.+)") + local topic = string.match(text, "/ud (.+)") or string.match(text, "http://([A-Za-z0-9-_-]+).urbanup.com/") topic = url_encode(topic) b = http.request("http://api.urbandictionary.com/v0/define?term=" .. topic) res = json:decode(b) @@ -34,6 +34,8 @@ end return { description = "Zeigt eine Urban Dictionary Definition", usage = {"/ud [Begriff]"}, - patterns = {"^/ud (.*)$"}, + patterns = {"^/ud (.*)$", + "^http://([A-Za-z0-9-_-]+).urbanup.com/" + }, run = run } \ No newline at end of file