From eb1ab46d64e64fe6ce5fc6bef02b18c3dac404e4 Mon Sep 17 00:00:00 2001 From: Francesco Ruvolo Date: Wed, 24 Jun 2015 18:49:59 +0200 Subject: [PATCH 1/5] boobs.lua: accept parameters --- plugins/boobs.lua | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/plugins/boobs.lua b/plugins/boobs.lua index b6fc3563..d79dba8f 100644 --- a/plugins/boobs.lua +++ b/plugins/boobs.lua @@ -38,21 +38,28 @@ local function getRandomBoobs(attempt) end local function run(msg, matches) - local url = nil + n = string.match(matches[1], '[0-9]+') - if matches[1] == "!boobs" then - url = getRandomBoobs() - end + if n ~= nil then + req = match_pattern("^![bosut]+", matches[1]) + for i = 1,n do run(msg, req) end + else + local url = nil + + if matches[1] == "!boobs" then + url = getRandomBoobs() + end - if matches[1] == "!butts" then - url = getRandomButts() - end + if matches[1] == "!butts" then + url = getRandomButts() + end - if url ~= nil then - local receiver = get_receiver(msg) - send_photo_from_url(receiver, url) - else - return 'Error getting boobs/butts for you, please try again later.' + if url ~= nil then + local receiver = get_receiver(msg) + send_photo_from_url(receiver, url) + else + return 'Error getting boobs/butts for you, please try again later.' + end end end @@ -64,7 +71,9 @@ return { }, patterns = { "^!boobs$", - "^!butts$" + "^!butts$", + "^!boobs [0-9]+$", + "^!butts [0-9]+$" }, run = run } From 5b36058ae4b173f9e6ead9bdd3cebe77e4bf80e3 Mon Sep 17 00:00:00 2001 From: Francesco Ruvolo Date: Thu, 25 Jun 2015 13:05:00 +0200 Subject: [PATCH 2/5] boobs.lua: changed usage text --- plugins/boobs.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/boobs.lua b/plugins/boobs.lua index d79dba8f..3e23245e 100644 --- a/plugins/boobs.lua +++ b/plugins/boobs.lua @@ -67,7 +67,9 @@ return { description = "Gets a random boobs or butts pic", usage = { "!boobs: Get a boobs NSFW image. 🔞", - "!butts: Get a butts NSFW image. 🔞" + "!boobs N: Get N boobs NSFW images. 🔞", + "!butts: Get a butts NSFW image. 🔞", + "!butts N: Get N butts NSFW images. 🔞", }, patterns = { "^!boobs$", From 2840ebbb01a5f9378dbb720da6bb00e7139bb3e6 Mon Sep 17 00:00:00 2001 From: Francesco Ruvolo Date: Fri, 26 Jun 2015 01:00:37 +0200 Subject: [PATCH 3/5] danbooru.lua: fix sending images twice --- plugins/danbooru.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/danbooru.lua b/plugins/danbooru.lua index b0e6c646..8b004e78 100644 --- a/plugins/danbooru.lua +++ b/plugins/danbooru.lua @@ -48,7 +48,7 @@ local function run(msg, matches) txt = txt .. 'Character: ' .. post.tag_string_character .. '\n' end if post.file_size ~= '' then - txt = txt .. '[' .. math.ceil(post.file_size/1000) .. 'kb] ' .. URL .. post.file_url + txt = txt .. '[' .. math.ceil(post.file_size/1000) .. 'kb] '-- .. URL .. post.file_url end return txt end @@ -71,4 +71,4 @@ return { run = run } -end \ No newline at end of file +end From 6faed62f7d75e6928eea332ffe5bcdf3ec1485fb Mon Sep 17 00:00:00 2001 From: Francesco Ruvolo Date: Sun, 28 Jun 2015 22:38:17 +0200 Subject: [PATCH 4/5] boobs.lua: maximum 20 pictures per request allowed --- plugins/boobs.lua | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/plugins/boobs.lua b/plugins/boobs.lua index 3e23245e..e2af9b16 100644 --- a/plugins/boobs.lua +++ b/plugins/boobs.lua @@ -38,28 +38,32 @@ local function getRandomBoobs(attempt) end local function run(msg, matches) - n = string.match(matches[1], '[0-9]+') + local n = string.match(matches[1], '[0-9]+') if n ~= nil then - req = match_pattern("^![bosut]+", matches[1]) - for i = 1,n do run(msg, req) end + if tonumber(n) <= 20 then + req = match_pattern("^![bosut]+", matches[1]) + for i = 1,n do run(msg, req) end + else + return "Too many pictures requested. Maximum 20 allowed." + end else - local url = nil - - if matches[1] == "!boobs" then - url = getRandomBoobs() - end + local url = nil + + if matches[1] == "!boobs" then + url = getRandomBoobs() + end - if matches[1] == "!butts" then - url = getRandomButts() - end + if matches[1] == "!butts" then + url = getRandomButts() + end - if url ~= nil then - local receiver = get_receiver(msg) - send_photo_from_url(receiver, url) - else - return 'Error getting boobs/butts for you, please try again later.' - end + if url ~= nil then + local receiver = get_receiver(msg) + send_photo_from_url(receiver, url) + else + return 'Error getting boobs/butts for you, please try again later.' + end end end From 7b1aca5309bd1048babfe75125e883cd11bb1457 Mon Sep 17 00:00:00 2001 From: Francesco Ruvolo Date: Wed, 17 Feb 2016 15:43:04 +0100 Subject: [PATCH 5/5] fix to tg/tgl/structures.c --- tg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tg b/tg index 3a898a42..e250f55a 160000 --- a/tg +++ b/tg @@ -1 +1 @@ -Subproject commit 3a898a42c10ed17ffeecb587ca09cdaa4b39e6b5 +Subproject commit e250f55a1357308805e0193c19dbf52a7862f446