update path command to have an optional p shortcut, enabled via config.ini; updated catfacts to have more and more accurate facts.

This commit is contained in:
agessaman
2025-11-14 18:40:25 -08:00
parent d963e75473
commit e0df11724f
3 changed files with 83 additions and 35 deletions
+5
View File
@@ -447,6 +447,11 @@ medium_confidence_symbol = 📍
# Low confidence (< 0.8): Shows when path decoding has uncertainty
low_confidence_symbol = ❓
# Enable "p" shortcut for path command (similar to "t" for test command)
# true: Respond to just "p" or "p <path_data>" as a shortcut for "path"
# false: Only respond to "path", "decode", or "route" keywords (default)
enable_p_shortcut = false
[Hacker]
# Enable or disable the hacker command
# true: Hacker command is available (responds to Linux commands with supervillain mainframe errors)
+61 -33
View File
@@ -27,46 +27,74 @@ class CatfactCommand(BaseCommand):
# Collection of cat facts
self.cat_facts = [
"Cats have a third eyelid called a nictitating membrane that helps keep their eyes moist and protected. 🐱",
"Cats have a third eyelid called a nictitating membrane that protects and moistens their eyes. 🐱",
"A group of cats is called a 'clowder' or a 'glaring'. 🐈",
"Cats can rotate their ears 180 degrees independently of each other. 👂",
"The oldest known pet cat existed 9,500 years ago and was found buried with its human in Cyprus. 🏺",
"Cats have over 30 muscles controlling their ears, while humans only have 6. 🎧",
"A cat's purr vibrates at a frequency of 25-150 Hz, which can promote healing of bones and tissues. 🩹",
"Cats spend 70% of their lives sleeping - that's 13-16 hours per day! 😴",
"Cats can rotate their ears 180 degrees independently to pinpoint sounds. 👂",
"The oldest known pet cat existed 9,500 years ago in Cyprus. 🏺",
"Cats have 32 muscles in each ear, while humans have only 6. 🎧",
"A cat's purr vibrates at 25-150 Hz, which can promote healing of bones and tissues. 🩹",
"Cats sleep 12-18 hours per day - that's 50-70% of their lives! 😴",
"A cat's nose print is unique, just like human fingerprints. 👃",
"Cats can't taste sweetness - they lack the taste receptors for sugar. 🍭",
"The world's richest cat, Blackie, inherited £7 million from his owner in 1988. 💰",
"Cats have a very small, free-floating clavicle that allows them to always land on their feet. 🦴",
"A cat's heart beats 140-220 times per minute, about twice as fast as a human's heart. ❤️",
"Cats have been known to survive falls from heights of over 20 stories due to their righting reflex. 🏢",
"The technical term for a cat's hairball is a 'bezoar'. 🤮",
"Cats can jump up to 6 times their body length in a single bound. 🦘",
"A cat's whiskers are roughly as wide as their body, helping them judge if they can fit through spaces. 📏",
"Cats have 32 muscles in each ear, compared to humans' 6. 🎯",
"The oldest cat ever recorded lived to be 38 years and 3 days old. 🎂",
"Cats can't taste sweetness due to a missing taste receptor gene. 🍭",
"Blackie the cat inherited £7 million ($12.5 million) in 1988. 💰",
"Cats have free-floating clavicles that give them extreme flexibility. 🦴",
"A cat's heart beats 140-220 times per minute, about twice as fast as a human's. ❤️",
"Cats can survive falls from over 20 stories due to their righting reflex. 🏢",
"The technical term for a cat's hairball is a 'trichobezoar'. 🤮",
"Cats can jump 5-6 times their body length in a single bound. 🦘",
"A cat's whiskers are as wide as their body, helping them judge if they can fit through spaces. 📏",
"Cats have 32 muscles in each ear to detect sounds and move ears independently. 🎯",
"The oldest cat ever lived to 38 years and 3 days (Creme Puff, Texas). 🎂",
"Cats can run up to 30 mph in short bursts. 🏃‍♂️",
"A cat's brain is 90% similar to a human's brain - they have the same regions for emotions. 🧠",
"Cats have a special organ called the Jacobson's organ that allows them to 'taste' smells. 👅",
"The first cat in space was a French cat named Félicette, launched in 1963. 🚀",
"Cats can see in near darkness - they only need 1/6th the light humans need to see. 🌙",
"Cat brains are 90% structurally similar to human brains. 🧠",
"Cats have Jacobson's organ in the roof of their mouth that lets them 'taste' scents. 👅",
"Félicette was the first cat in space, launched by France in 1963. 🚀",
"Cats need only 1/6th the light humans need to see clearly in the dark. 🌙",
"A cat's tail contains nearly 10% of all the bones in its body. 🦴",
"Cats have been domesticated for over 4,000 years, longer than dogs. 🏛️",
"The world's largest cat measured 48.5 inches long from nose to tail tip. 📏",
"Cats can make over 100 different sounds, while dogs can only make about 10. 🎵",
"The world's longest cat measured 48.5 inches from nose to tail (Stewie, Maine Coon). 📏",
"Cats can make over 100 different vocalizations, while dogs make about 10. 🎵",
"A cat's sense of smell is 14 times stronger than a human's. 👃",
"Cats have a 'flehmen response' where they curl their lip to better detect scents. 😬",
"The first cat show was held in London in 1871. 🏆",
"Cats can drink seawater to survive - their kidneys can filter out the salt. 🌊",
"A cat's purr can help lower blood pressure and reduce stress in humans. 🧘‍♀️",
"Cats have been known to travel hundreds of miles to return to their homes. 🗺️",
"The first major cat show was held in London in 1871 at Crystal Palace. 🏆",
"Cats can drink seawater to survive - their kidneys filter out the salt efficiently. 🌊",
"A cat's purr can help lower blood pressure and reduce stress in humans. 🧘",
"Cats can travel hundreds of miles home using their magnetic field sensitivity. 🗺️",
"The smallest cat breed is the Singapura, weighing only 4-8 pounds. ⚖️",
"Cats can see ultraviolet light, which humans cannot see. 🌈",
"A cat's tongue is covered in tiny, backward-facing hooks called papillae. 🪝",
"Cats have been worshipped as gods in ancient Egypt - they never forgot this. 👑",
"The world's most expensive cat breed is the Ashera, costing up to $125,000. 💎",
"Cats can rotate their ears 180 degrees and move them independently. 🎧",
"A cat's heart beats 140-220 times per minute, twice as fast as a human's. 💓"
"Cats can see ultraviolet light that humans cannot see. 🌈",
"A cat's tongue is covered in 290-300 tiny backward-facing hooks called papillae. 🪝",
"Ancient Egyptians considered cats sacred vessels for the goddess Bastet. 👑",
"Taylor Swift's cat Olivia Benson has a net worth of $97 million. 💎",
"Cats have 230 bones in their body - 24 more than humans have. 🦴",
"Cats can hear frequencies up to 64,000 Hz, while humans max out at 20,000 Hz. 🎧",
"Taylor Swift's cat Benjamin Button appeared on her TIME Person of the Year cover. 📰",
"Taylor Swift's cats are named Meredith Grey, Olivia Benson, and Benjamin Button. 🎸",
"Cats walk like camels and giraffes, moving both right legs then both left legs. 🐾",
"The ancient Egyptian word for cat was 'Miu' or 'Mau' - sounding like a meow! 📜",
"Cat whiskers have nerve endings as sensitive as human fingertips. 🎯",
"Only domestic cats walk with their tails held high as a sign of trust and happiness. 🐈",
"Cats have 250 million neurons in their cerebral cortex - more than dogs have. 🧠",
"Cat purrs vibrate at the same frequency as bone-healing medical devices. 💊",
"Taylor Swift's cat Olivia has earned millions from appearing in music videos and ads. 💸",
"Killing a cat in ancient Egypt was punishable by death. ⚖️",
"Taylor Swift named her home recording studio 'The Itty Bitty Kitty Committee'. 🎤",
"Taylor Swift's cat Olivia Benson is the official logo for Taylor Swift Productions. 📺",
"Ed Sheeran bought Scottish Fold cats after being inspired by Taylor Swift's cats. 🎶",
"Taylor Swift's cats have their own IMDB pages with acting credits. 🎬",
"Mariska Hargitay named her cat 'Karma' after Taylor Swift's song. 💕",
"Cats have dewclaws on their front paws that work like thumbs for gripping. 🐾",
"Cat pupils can expand to 50% larger than human pupils to capture more light. 👁️",
"Cats have 30 adult teeth compared to humans' 32. 🦷",
"Cats can taste ATP (energy molecules), which signals fresh meat to them. 😋",
"Cats have whiskers on the backs of their front legs to detect prey movement. 🦵",
"The Egyptian Mau is the fastest domestic cat breed at 30 mph. 🏃",
"A Nobel Prize was awarded in 1981 for research using cat vision studies. 🏅",
"Cats are digitigrade, meaning they walk on their toes, not flat-footed. 🦶",
"Cats can filter salt from seawater - an adaptation from their desert-dwelling ancestors. 🏜️",
"Cats were domesticated around 10,000-12,000 years ago in the Near East. 🌍",
"Benjamin Button is the first and only cat to ever appear on TIME Person of the Year cover. 📸",
"A cat's flexible spine allows them to rotate their body mid-air when falling. 🤸",
"Cats spend about 30-50% of their day grooming themselves and other cats. 🛁",
"A cat's average body temperature is 101.5°F (38.6°C) - higher than humans. 🌡️"
]
def get_help_text(self) -> str:
+17 -2
View File
@@ -49,6 +49,13 @@ class PathCommand(BaseCommand):
self.medium_confidence_symbol = bot.config.get('Path_Command', 'medium_confidence_symbol', fallback='📍')
self.low_confidence_symbol = bot.config.get('Path_Command', 'low_confidence_symbol', fallback='')
# Check if "p" shortcut is enabled (off by default)
self.enable_p_shortcut = bot.config.getboolean('Path_Command', 'enable_p_shortcut', fallback=False)
if self.enable_p_shortcut:
# Add "p" to keywords if enabled
if "p" not in self.keywords:
self.keywords.append("p")
try:
# Try to get location from Bot section
if bot.config.has_section('Bot'):
@@ -74,15 +81,23 @@ class PathCommand(BaseCommand):
self.logger.warning(f"Error reading bot location from config: {e} - geographic proximity guessing disabled")
def matches_keyword(self, message: MeshMessage) -> bool:
"""Check if message starts with 'path' keyword"""
"""Check if message starts with 'path' keyword or 'p' shortcut (if enabled)"""
content = message.content.strip()
# Handle exclamation prefix
if content.startswith('!'):
content = content[1:].strip()
# Check if message starts with any of our keywords
content_lower = content.lower()
# Handle "p" shortcut if enabled
if self.enable_p_shortcut:
if content_lower == "p":
return True # Just "p" by itself
elif (content.startswith('p ') or content.startswith('P ')) and len(content) > 2:
return True # "p " followed by path data
# Check if message starts with any of our keywords
for keyword in self.keywords:
# Check for exact match or keyword followed by space
if content_lower == keyword or content_lower.startswith(keyword + ' '):