Some code clean up

This commit is contained in:
yago
2014-11-22 15:05:54 +01:00
parent 8698082b3a
commit e11b393643
7 changed files with 18 additions and 36 deletions

View File

@@ -2,7 +2,9 @@
function run(msg, matches)
local ret = ""
for k, dict in pairs(plugins) do
ret = ret .. dict.usage .. " -> " .. dict.description .. "\n"
if dict.usage ~= "" then
ret = ret .. dict.usage .. " -> " .. dict.description .. "\n"
end
end
return ret
end
@@ -12,5 +14,4 @@ return {
usage = "!help",
patterns = {"^!help$"},
run = run
}
}

View File

@@ -6,7 +6,7 @@ function run(msg, matches)
end
return {
description = "from image URL downloads it and sends to origin",
description = "When user sends image URL (ends with png, jpg, jpeg) download and send it to origin.",
usage = "",
patterns = {
"(https?://[%w-_%.%?%.:/%+=&]+.png)$",

View File

@@ -5,7 +5,7 @@ function run(msg, matches)
end
return {
description = "from media URL downloads it and sends to origin",
description = "When user sends media URL (ends with gif, mp4, pdf, etc.) download and send it to origin.",
usage = "",
patterns = {
"(https?://[%w-_%.%?%.:/%+=&]+.gif)$",

View File

@@ -61,7 +61,7 @@ function run(msg, matches)
end
return {
description = "Shows a tweet",
description = "When user sends twitter URL, send text and images to origin. Requieres OAuth Key.",
usage = "",
patterns = {"https://twitter.com/[^/]+/status/([0-9]+)"},
run = run

View File

@@ -8,7 +8,7 @@ function run(msg, matches)
end
return {
description = "Shows the bot version",
description = "Shows bot version",
usage = "!version",
patterns = {"^!version$"},
run = run