diff --git a/plugins/boobs.lua b/plugins/boobs.lua index b6fc3563..e2af9b16 100644 --- a/plugins/boobs.lua +++ b/plugins/boobs.lua @@ -38,21 +38,32 @@ local function getRandomBoobs(attempt) end local function run(msg, matches) - local url = nil + local n = string.match(matches[1], '[0-9]+') - if matches[1] == "!boobs" then - url = getRandomBoobs() - end + if n ~= nil then + 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 - 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 @@ -60,11 +71,15 @@ 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$", - "^!butts$" + "^!butts$", + "^!boobs [0-9]+$", + "^!butts [0-9]+$" }, run = run } 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 diff --git a/tg b/tg index 3a898a42..e250f55a 160000 --- a/tg +++ b/tg @@ -1 +1 @@ -Subproject commit 3a898a42c10ed17ffeecb587ca09cdaa4b39e6b5 +Subproject commit e250f55a1357308805e0193c19dbf52a7862f446