paper-dynasty-discord/random_content.py
Cal Corum ee80cd72ae fix: apply Black formatting and resolve ruff lint violations
Run Black formatter across 83 files and fix 1514 ruff violations:
- E722: bare except → typed exceptions (17 fixes)
- E711/E712/E721: comparison style fixes with noqa for SQLAlchemy (44 fixes)
- F841: unused variable assignments (70 fixes)
- F541/F401: f-string and import cleanup (1383 auto-fixes)

Remaining 925 errors are all F403/F405 (star imports) — structural,
requires converting to explicit imports in a separate effort.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 11:37:46 -05:00

871 lines
19 KiB
Python

"""
Random Content Generators
This module contains all the random content generation functions including
GIFs, phrases, codenames, and other content used for bot interactions.
"""
import random
import logging
import requests
from helpers.constants import INSULTS
logger = logging.getLogger("discord_app")
def random_conf_gif():
"""Returns a random confirmation GIF URL."""
conf_gifs = [
"https://tenor.com/view/boom-annakendrick-pitchperfect-pitchperfect2-micdrop-gif-5143507",
"https://tenor.com/view/boom-annakendrick-pitchperfect-pitchperfect2-micdrop-gif-5143507",
"https://tenor.com/view/boom-annakendrick-pitchperfect-pitchperfect2-micdrop-gif-5143507",
"https://tenor.com/view/explosion-boom-iron-man-gif-14282225",
"https://tenor.com/view/betty-white-dab-consider-it-done-gif-11972415",
"https://tenor.com/view/done-and-done-spongebob-finished-just-did-it-gif-10843280",
"https://tenor.com/view/thumbs-up-okay-ok-well-done-gif-13840394",
"https://tenor.com/view/tinkerbell-peter-pan-all-done-gif-15003723",
"https://tenor.com/view/done-and-done-ron-swanson-gotchu-gif-10843254",
"https://tenor.com/view/sponge-bob-thumbs-up-ok-smile-gif-12038157",
"https://tenor.com/view/thumbs-up-cool-okay-bye-gif-8633196",
"https://i0.wp.com/media1.giphy.com/media/iwvuPyfi7z14I/giphy.gif",
"https://media1.tenor.com/images/859a2d3b201fbacec13904242976b9e0/tenor.gif",
"https://tenor.com/bc1OJ.gif",
"https://tenor.com/1EmF.gif",
"https://tenor.com/ZYCh.gif",
"https://tenor.com/patd.gif",
"https://tenor.com/u6mU.gif",
"https://tenor.com/x2sa.gif",
"https://tenor.com/bAVeS.gif",
"https://tenor.com/bxOcj.gif",
"https://tenor.com/ETJ7.gif",
"https://tenor.com/bpH3g.gif",
"https://tenor.com/biF9q.gif",
"https://tenor.com/OySS.gif",
"https://tenor.com/bvVFv.gif",
"https://tenor.com/bFeqA.gif",
]
return conf_gifs[random.randint(0, len(conf_gifs) - 1)]
def random_no_gif():
"""Returns a random 'no' reaction GIF URL."""
no_gifs = [
"https://tenor.com/view/youre-not-my-dad-dean-jensen-ackles-supernatural-you-arent-my-dad-gif-19503399",
"https://tenor.com/view/youre-not-my-dad-kid-gif-8300190",
"https://tenor.com/view/youre-not-my-supervisor-youre-not-my-boss-gif-12971403",
"https://tenor.com/view/dont-tell-me-what-to-do-gif-4951202",
]
return no_gifs[random.randint(0, len(no_gifs) - 1)]
def random_salute_gif():
"""Returns a random salute GIF URL."""
salute_gifs = [
"https://media.giphy.com/media/fSAyceY3BCgtiQGnJs/giphy.gif",
"https://media.giphy.com/media/bsWDUSFUmJCOk/giphy.gif",
"https://media.giphy.com/media/hStvd5LiWCFzYNyxR4/giphy.gif",
"https://media.giphy.com/media/RhSR5xXDsXJ7jbnrRW/giphy.gif",
"https://media.giphy.com/media/lNQvrlPdbmZUU2wlh9/giphy.gif",
"https://gfycat.com/skeletaldependableandeancat",
"https://i.gifer.com/5EJk.gif",
"https://tenor.com/baJUV.gif",
"https://tenor.com/bdnQH.gif",
"https://tenor.com/bikQU.gif",
"https://i.pinimg.com/originals/04/36/bf/0436bfc9861b4b57ffffda82d3adad6e.gif",
"https://media.giphy.com/media/6RtOG4Q7v34kw/giphy.gif",
"https://keyassets-p2.timeincuk.net/wp/prod/wp-content/uploads/sites/42/2017/04/anigif_"
"enhanced-946-1433453114-7.gif",
"https://keyassets-p2.timeincuk.net/wp/prod/wp-content/uploads/sites/42/2017/04/100c5d677cc28ea3f15"
"4c70d641f655b_meme-crying-gif-crying-gif-meme_620-340.gif",
"https://media.giphy.com/media/fnKd6rCHaZoGdzLjjA/giphy.gif",
"https://media.giphy.com/media/47D5jmVc4f7ylygXYD/giphy.gif",
"https://media.giphy.com/media/I4wGMXoi2kMDe/giphy.gif",
]
return salute_gifs[random.randint(0, len(salute_gifs) - 1)]
def random_conf_word():
"""Returns a random confirmation word."""
conf_words = [
"dope",
"cool",
"got it",
"noice",
"ok",
"lit",
]
return conf_words[random.randint(0, len(conf_words) - 1)]
def random_codename():
"""Returns a random codename from a large list of options."""
all_names = [
"Shong",
"DerekSux",
"JoeSux",
"CalSux",
"Friend",
"Andrea",
"Ent",
"Lindved",
"Camp",
"Idyll",
"Elaphus",
"Turki",
"Shrimp",
"Primary",
"Anglica",
"Shail",
"Blanket",
"Baffled",
"Deer",
"Thisted",
"Brisk",
"Shy",
"Table",
"Jorts",
"Renati",
"Gisky",
"Prig",
"Bathtub",
"Gallery",
"Mavas",
"Chird",
"Oxyura",
"Mydal",
"Brown",
"Vasen",
"Worthy",
"Bivver",
"Cirlus",
"Self",
"Len",
"Sharp",
"Dart",
"Crepis",
"Ferina",
"Curl",
"Lancome",
"Stuff",
"Glove",
"Consist",
"Smig",
"Egg",
"Pleat",
"Picture",
"Spin",
"Ridgty",
"Ickled",
"Abashed",
"Haul",
"Cordage",
"Chivery",
"Stointy",
"Baa",
"Here",
"Ulmi",
"Tour",
"Tribe",
"Crunch",
"Used",
"Pigface",
"Audit",
"Written",
"Once",
"Fickle",
"Drugged",
"Swarm",
"Blimber",
"Torso",
"Retusa",
"Hockey",
"Pusty",
"Sallow",
"Next",
"Mansion",
"Glass",
"Screen",
"Josiah",
"Bonkey",
"Stuff",
"Sane",
"Blooded",
"Gnat",
"Liparis",
"Ocean",
"Sway",
"Roband",
"Still",
"Ribba",
"Biryani",
"Halibut",
"Flyn",
"Until",
"Depend",
"Intel",
"Affinis",
"Chef",
"Trounce",
"Crawl",
"Grab",
"Eggs",
"Malfroy",
"Sitta",
"Cretin",
"May",
"Smithii",
"Saffron",
"Crummy",
"Powered",
"Rail",
"Trait",
"Koiled",
"Bronze",
"Quickly",
"Vikis",
"Trift",
"Jubilar",
"Deft",
"Juncus",
"Sodding",
"Distant",
"Poecile",
"Pipe",
"Sell",
"Inops",
"Peusi",
"Sparrow",
"Yams",
"Kidneys",
"Artery",
"Vuffin",
"Boink",
"Bos",
"Notable",
"Alba",
"Spurge",
"Ruby",
"Cilia",
"Pellow",
"Nox",
"Woozy",
"Semvik",
"Tyda",
"Season",
"Lychnis",
"Ibestad",
"Bagge",
"Marked",
"Browdie",
"Fisher",
"Tilly",
"Troll",
"Gypsy",
"Thisted",
"Flirt",
"Stop",
"Radiate",
"Poop",
"Plenty",
"Jeff",
"Magpie",
"Roof",
"Ent",
"Dumbo",
"Pride",
"Weights",
"Winted",
"Dolden",
"Meotica",
"Yikes",
"Teeny",
"Fizz",
"Eide",
"Foetida",
"Crash",
"Mann",
"Salong",
"Cetti",
"Balloon",
"Petite",
"Find",
"Sputter",
"Patula",
"Upstage",
"Aurora",
"Dadson",
"Drate",
"Heidal",
"Robin",
"Auditor",
"Ithil",
"Warmen",
"Pat",
"Muppet",
"007",
"Advantage",
"Alert",
"Backhander",
"Badass",
"Blade",
"Blaze",
"Blockade",
"Blockbuster",
"Boxer",
"Brimstone",
"Broadway",
"Buccaneer",
"Champion",
"Cliffhanger",
"Coachman",
"Comet",
"Commander",
"Courier",
"Cowboy",
"Crawler",
"Crossroads",
"DeepSpace",
"Desperado",
"Double-Decker",
"Echelon",
"Edge",
"Encore",
"EnRoute",
"Escape",
"Eureka",
"Evangelist",
"Excursion",
"Explorer",
"Fantastic",
"Firefight",
"Foray",
"Forge",
"Freeway",
"Frontier",
"FunMachine",
"Galaxy",
"GameOver",
"Genesis",
"Hacker",
"Hawkeye",
"Haybailer",
"Haystack",
"Hexagon",
"Hitman",
"Hustler",
"Iceberg",
"Impossible",
"Impulse",
"Invader",
"Inventor",
"IronWolf",
"Jackrabbit",
"Juniper",
"Keyhole",
"Lancelot",
"Liftoff",
"MadHatter",
"Magnum",
"Majestic",
"Merlin",
"Multiplier",
"Netiquette",
"Nomad",
"Octagon",
"Offense",
"OliveBranch",
"OlympicTorch",
"Omega",
"Onyx",
"Orbit",
"OuterSpace",
"Outlaw",
"Patron",
"Patriot",
"Pegasus",
"Pentagon",
"Pilgrim",
"Pinball",
"Pinnacle",
"Pipeline",
"Pirate",
"Portal",
"Predator",
"Prism",
"RagingBull",
"Ragtime",
"Reunion",
"Ricochet",
"Roadrunner",
"Rockstar",
"RobinHood",
"Rover",
"Runabout",
"Sapphire",
"Scrappy",
"Seige",
"Shadow",
"Shakedown",
"Shockwave",
"Shooter",
"Showdown",
"SixPack",
"SlamDunk",
"Slasher",
"Sledgehammer",
"Spirit",
"Spotlight",
"Starlight",
"Steamroller",
"Stride",
"Sunrise",
"Superhuman",
"Supernova",
"SuperBowl",
"Sunset",
"Sweetheart",
"TopHand",
"Touchdown",
"Tour",
"Trailblazer",
"Transit",
"Trekker",
"Trio",
"TriplePlay",
"TripleThreat",
"Universe",
"Unstoppable",
"Utopia",
"Vicinity",
"Vector",
"Vigilance",
"Vigilante",
"Vista",
"Visage",
"Vis-à-vis",
"VIP",
"Volcano",
"Volley",
"Whizzler",
"Wingman",
"Badger",
"BlackCat",
"Bobcat",
"Caracal",
"Cheetah",
"Cougar",
"Jaguar",
"Leopard",
"Lion",
"Lynx",
"MountainLion",
"Ocelot",
"Panther",
"Puma",
"Siamese",
"Serval",
"Tiger",
"Wolverine",
"Abispa",
"Andrena",
"BlackWidow",
"Cataglyphis",
"Centipede",
"Cephalotes",
"Formica",
"Hornet",
"Jellyfish",
"Scorpion",
"Tarantula",
"Yellowjacket",
"Wasp",
"Apollo",
"Ares",
"Artemis",
"Athena",
"Hercules",
"Hermes",
"Iris",
"Medusa",
"Nemesis",
"Neptune",
"Perseus",
"Poseidon",
"Triton",
"Zeus",
"Aquarius",
"Aries",
"Cancer",
"Capricorn",
"Gemini",
"Libra",
"Leo",
"Pisces",
"Sagittarius",
"Scorpio",
"Taurus",
"Virgo",
"Andromeda",
"Aquila",
"Cassiopeia",
"Cepheus",
"Cygnus",
"Delphinus",
"Drako",
"Lyra",
"Orion",
"Perseus",
"Serpens",
"Triangulum",
"Anaconda",
"Boa",
"Cobra",
"Copperhead",
"Cottonmouth",
"Garter",
"Kingsnake",
"Mamba",
"Python",
"Rattler",
"Sidewinder",
"Taipan",
"Viper",
"Alligator",
"Barracuda",
"Crocodile",
"Gator",
"GreatWhite",
"Hammerhead",
"Jaws",
"Lionfish",
"Mako",
"Moray",
"Orca",
"Piranha",
"Shark",
"Stingray",
"Axe",
"BattleAxe",
"Bayonet",
"Blade",
"Crossbowe",
"Dagger",
"Excalibur",
"Halberd",
"Hatchet",
"Machete",
"Saber",
"Samurai",
"Scimitar",
"Scythe",
"Stiletto",
"Spear",
"Sword",
"Aurora",
"Avalanche",
"Blizzard",
"Cyclone",
"Dewdrop",
"Downpour",
"Duststorm",
"Fogbank",
"Freeze",
"Frost",
"GullyWasher",
"Gust",
"Hurricane",
"IceStorm",
"JetStream",
"Lightning",
"Mist",
"Monsoon",
"Rainbow",
"Raindrop",
"SandStorm",
"Seabreeze",
"Snowflake",
"Stratosphere",
"Storm",
"Sunrise",
"Sunset",
"Tornado",
"Thunder",
"Thunderbolt",
"Thunderstorm",
"TropicalStorm",
"Twister",
"Typhoon",
"Updraft",
"Vortex",
"Waterspout",
"Whirlwind",
"WindChill",
"Archimedes",
"Aristotle",
"Confucius",
"Copernicus",
"Curie",
"daVinci",
"Darwin",
"Descartes",
"Edison",
"Einstein",
"Epicurus",
"Freud",
"Galileo",
"Hawking",
"Machiavelli",
"Marx",
"Newton",
"Pascal",
"Pasteur",
"Plato",
"Sagan",
"Socrates",
"Tesla",
"Voltaire",
"Baccarat",
"Backgammon",
"Blackjack",
"Chess",
"Jenga",
"Jeopardy",
"Keno",
"Monopoly",
"Pictionary",
"Poker",
"Scrabble",
"TrivialPursuit",
"Twister",
"Roulette",
"Stratego",
"Yahtzee",
"Aquaman",
"Batman",
"BlackPanther",
"BlackWidow",
"CaptainAmerica",
"Catwoman",
"Daredevil",
"Dr.Strange",
"Flash",
"GreenArrow",
"GreenLantern",
"Hulk",
"IronMan",
"Phantom",
"Thor",
"SilverSurfer",
"SpiderMan",
"Supergirl",
"Superman",
"WonderWoman",
"Wolverine",
"Hypersonic",
"Lightspeed",
"Mach1,2,3,4,etc",
"Supersonic",
"WarpSpeed",
"Amiatina",
"Andalusian",
"Appaloosa",
"Clydesdale",
"Colt",
"Falabella",
"Knabstrupper",
"Lipizzan",
"Lucitano",
"Maverick",
"Mustang",
"Palomino",
"Pony",
"QuarterHorse",
"Stallion",
"Thoroughbred",
"Zebra",
"Antigua",
"Aruba",
"Azores",
"Baja",
"Bali",
"Barbados",
"Bermuda",
"BoraBora",
"Borneo",
"Capri",
"Cayman",
"Corfu",
"Cozumel",
"Curacao",
"Fiji",
"Galapagos",
"Hawaii",
"Ibiza",
"Jamaica",
"Kauai",
"Lanai",
"Majorca",
"Maldives",
"Maui",
"Mykonos",
"Nantucket",
"Oahu",
"Tahiti",
"Tortuga",
"Roatan",
"Santorini",
"Seychelles",
"St.Johns",
"St.Lucia",
"Albatross",
"BaldEagle",
"Blackhawk",
"BlueJay",
"Chukar",
"Condor",
"Crane",
"Dove",
"Eagle",
"Falcon",
"Goose(GoldenGoose)",
"Grouse",
"Hawk",
"Heron",
"Hornbill",
"Hummingbird",
"Lark",
"Mallard",
"Oriole",
"Osprey",
"Owl",
"Parrot",
"Penguin",
"Peregrine",
"Pelican",
"Pheasant",
"Quail",
"Raptor",
"Raven",
"Robin",
"Sandpiper",
"Seagull",
"Sparrow",
"Stork",
"Thunderbird",
"Toucan",
"Vulture",
"Waterfowl",
"Woodpecker",
"Wren",
"C-3PO",
"Chewbacca",
"Dagobah",
"DarthVader",
"DeathStar",
"Devaron",
"Droid",
"Endor",
"Ewok",
"Hoth",
"Jakku",
"Jedi",
"Leia",
"Lightsaber",
"Lothal",
"Naboo",
"Padawan",
"R2-D2",
"Scarif",
"Sith",
"Skywalker",
"Stormtrooper",
"Tatooine",
"Wookie",
"Yoda",
"Zanbar",
"Canoe",
"Catamaran",
"Cruiser",
"Cutter",
"Ferry",
"Galleon",
"Gondola",
"Hovercraft",
"Hydrofoil",
"Jetski",
"Kayak",
"Longboat",
"Motorboat",
"Outrigger",
"PirateShip",
"Riverboat",
"Sailboat",
"Skipjack",
"Schooner",
"Skiff",
"Sloop",
"Steamboat",
"Tanker",
"Trimaran",
"Trawler",
"Tugboat",
"U-boat",
"Yacht",
"Yawl",
"Lancer",
"Volunteer",
"Searchlight",
"Passkey",
"Deacon",
"Rawhide",
"Timberwolf",
"Eagle",
"Tumbler",
"Renegade",
"Mogul",
]
this_name = all_names[random.randint(0, len(all_names) - 1)]
return this_name
def random_no_phrase():
"""Returns a random 'no' phrase."""
phrases = [
"uhh...no",
"lol no",
"nope",
]
return phrases[random.randint(0, len(phrases) - 1)]
def random_gif(search_term: str):
"""
Fetches a random GIF from Giphy API based on search term.
Falls back to random_conf_gif() if request fails or contains 'trump'.
"""
req_url = f"https://api.giphy.com/v1/gifs/translate?s={search_term}&api_key=H86xibttEuUcslgmMM6uu74IgLEZ7UOD"
resp = requests.get(req_url, timeout=3)
if resp.status_code == 200:
data = resp.json()
if "trump" in data["data"]["title"]:
return random_conf_gif()
else:
return data["data"]["url"]
else:
logger.warning(resp.text)
raise ValueError(f"DB: {resp.text}")
def random_from_list(data_list: list):
"""Returns a random item from the provided list."""
item = data_list[random.randint(0, len(data_list) - 1)]
logger.info(f"random_from_list: {item}")
return item
def random_insult() -> str:
"""Returns a random insult from the INSULTS constant."""
return random_from_list(INSULTS)