Into the trash it goes!

This commit is contained in:
Jon Michael Aanes 2018-06-13 10:10:08 +02:00
parent bf340a5daf
commit 944fcc81c9
3 changed files with 26 additions and 1 deletions

BIN
images/into_the_trash.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 KiB

View File

@ -88,8 +88,9 @@ end
--------------------------------------------------------------------------------
-- Search wikipedia for images on pages
--[[
local WIKIPEDIA_API_URL = 'https://%s.wikipedia.org/w/api.php?action=query&titles=%s&prop=pageimages&format=json&piprop=original&redirects=1&prop=categories&prop=links'
--[[
local WIKIPEDIA_DISAMBIGUATION_CATEGORIES_FOR_LANG = {
da = 'Kategori:Flertydig',
en = 'Category:All disambiguation pages'

View File

@ -382,6 +382,12 @@ local generate_skorsten_image = generate_comparison_meme_generator {
{ x = 646, xr = 0, y = 366, yr = 0, w = 631, h = 215, font_color = COLOR_WHITE },
}
local generate_into_the_trash = generate_comparison_meme_generator {
base_img_path = './images/into_the_trash.png',
{ x = 377, xr = 20, y = 261, yr = 20, w = 400, h = 400, font_color = COLOR_BLACK },
}
local GENERATE_COMPARISON_MEME_OF_2 = {
generate_distracted_boyfriend,
generate_distracted_boyfriend_oldy_times,
@ -518,6 +524,24 @@ function memes.generate_for_message (user, message)
end
end
-- Into the trash
do
-- Attempt to match
local problem_text
for _, pattern in ipairs { '^(.-)%s+er%s+skrald(.-)$', '^(.-)%s+is%s+trash(.-)$' } do
problem_text = message:lower():match(pattern)
if problem_text then break end
end
-- Create image based on match
if problem_text then
print(problem_text)
local topic = fill_in_topics_information { problem_text }
local img_link = generate_into_the_trash(topic)
return img_link, 'TRASH'
end
end
-- Comparison memes
local topics = get_topics_from_comparison_message(message)
if not topics then return end