diff --git a/crimsobot/cogs/image.py b/crimsobot/cogs/image.py index cbdcd813..3ea89e90 100644 --- a/crimsobot/cogs/image.py +++ b/crimsobot/cogs/image.py @@ -9,7 +9,16 @@ from discord.ext import commands from crimsobot.bot import CrimsoBOT -from crimsobot.data.img import AENIMA, AEROPLANE, CAPTION_RULES, CURRENTS, IMAGE_RULES, LATERALUS, URL_CONTAINS +from crimsobot.data.img import ( + AENIMA, + AEROPLANE, + CAPTION_RULES, + CURRENTS, + DAMN, + IMAGE_RULES, + LATERALUS, + URL_CONTAINS, +) from crimsobot.exceptions import BadCaption, NoImageFound from crimsobot.utils import image as imagetools, tools as c @@ -309,6 +318,18 @@ async def currents(self, ctx: commands.Context, image: Optional[str] = None) -> title = random.choice(CURRENTS) await self.get_image_and_embed(ctx, image, effect, flip, title) + @commands.command() + async def damn(self, ctx: commands.Context, image: Optional[str] = None) -> None: + """Make a new cover for DAMN.""" + + effect = 'damn' + title = random.choice(DAMN) + + if image is None: + image = await self.get_previous_image(ctx) # will be a URL + + await self.get_image_and_embed(ctx, image, effect, None, title) + @commands.command(hidden=True) @commands.cooldown(1, 8 * 60 * 60, commands.BucketType.user) @shared_max_concurrency(eface_bucket) diff --git a/crimsobot/data/img/__init__.py b/crimsobot/data/img/__init__.py index 599c9092..3029e211 100644 --- a/crimsobot/data/img/__init__.py +++ b/crimsobot/data/img/__init__.py @@ -24,6 +24,7 @@ AENIMA = _ruleset['aenima'] AEROPLANE = _ruleset['aeroplane'] CURRENTS = _ruleset['currents'] +DAMN = _ruleset['damn'] LATERALUS = _ruleset['lateralus'] diff --git a/crimsobot/data/img/damn.png b/crimsobot/data/img/damn.png new file mode 100644 index 00000000..eadca0e2 Binary files /dev/null and b/crimsobot/data/img/damn.png differ diff --git a/crimsobot/data/img/rules.yaml b/crimsobot/data/img/rules.yaml index 15535194..38759dc2 100644 --- a/crimsobot/data/img/rules.yaml +++ b/crimsobot/data/img/rules.yaml @@ -149,6 +149,49 @@ currents: - Feel like a brand new person (but you'll make the same old mistakes) - Well I don't care, I'm in love - Maybe fake's what I like +damn: + - Is it wickedness? + - Hello, ma'am, can I be of any assistance? + - You have lost—you have lost—your life + - I got I got I got I got + - See you's a you's a you's a— + - Your DNA an abomination + - I got so many theories and suspicions + - Fox News wanna use my name for percentage + - And Deuteronomy say that we all been cursed + - Thirty millions later, know the feds watchin' + - They won't take me out my element + - Damn, damn, damn it's a goddamn shame + - Ain't nobody prayin' for me + - I feel like a chip on my shoulders + - The world is ending, I'm done pretendin' + - I said I'm geeked and I'm fired up + - Loyalty, loyalty, loyalty + - I'm a savage, I'm an asshole, I'm a king + - Flesh-making, spirit-breaking, which one would you lessen? + - Maybe I wasn't there + - Sick venom in men and women overcome with pride + - Ayy, I remember syrup sandwiches and crime allowances + - My left stroke just went viral + - Sit down. Be humble. + - I need some water—something came over me + - Way too high to simmer down + - Hop on the 'gram, flex on the bitches that be hatin' on you + - Sipping bubbly, feeling lovely, Heaven lovely—just love me + - Keep it 💯 I'd rather you trust me than to love me + - Give me a run for my money + - America—God bless you if it's good to you. + - Leave him in the wilderness with a sworn nemesis + - This country is to be a sound of drum and bass + - Why God, why God do I gotta suffer? + - I'm high now, I'm high now + - I'll prob'ly die anonymous + - This what God feel like, yeah + - I'm in the streets sometimes and can't afford it + - Flex on swole like aha, yeah + - It was always me versus the world + - Just remember what happens on earth stays on earth + - Life is is one funny mothafucker lateralus: - Saturn ascends - Clutch it like a cornerstone diff --git a/crimsobot/utils/image.py b/crimsobot/utils/image.py index bb029848..f9ec5413 100644 --- a/crimsobot/utils/image.py +++ b/crimsobot/utils/image.py @@ -555,6 +555,22 @@ def make_currents_img(img: Image.Image, flip: bool) -> Image.Image: return back +def make_damn_img(img: Image.Image, arg: None) -> Image.Image: + # 1. determine user image size, resize to fit in its place + width, height = img.size + + # resize to width + ratio = width / 600 + + img = img.resize((int(width / ratio), int(height / ratio)), resample=Image.BICUBIC) + + # 2. paste wordmark over result + with Image.open(c.clib_path_join('img', 'damn.png')) as wordmark: + img.alpha_composite(wordmark, (0, 0)) + + return img + + def make_lateralus_img(img: Image.Image, arg: None) -> Image.Image: img = img.convert('RGBA') @@ -722,6 +738,7 @@ def process_lower_level(img: Image.Image, effect: str, arg: int) -> BytesIO: 'aeroplane': make_aeroplane_img, 'caption': make_captioned_img, 'currents': make_currents_img, + 'damn': make_damn_img, 'lateralus': make_lateralus_img, 'needban': make_needban_img, 'needping': make_needping_img,