Skip to content

Commit

Permalink
Album cover generator for DAMN.
Browse files Browse the repository at this point in the history
  • Loading branch information
h-anjru committed Jul 31, 2024
1 parent 02e1750 commit 10ba80b
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 1 deletion.
23 changes: 22 additions & 1 deletion crimsobot/cogs/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions crimsobot/data/img/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
AENIMA = _ruleset['aenima']
AEROPLANE = _ruleset['aeroplane']
CURRENTS = _ruleset['currents']
DAMN = _ruleset['damn']
LATERALUS = _ruleset['lateralus']


Expand Down
Binary file added crimsobot/data/img/damn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions crimsobot/data/img/rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 17 additions & 0 deletions crimsobot/utils/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 10ba80b

Please sign in to comment.