Added howling dictionary with conditional selection

kami_dev
Kami 2025-02-02 00:59:53 +01:00
parent c4e51abc5b
commit 095514d95d
3 changed files with 90 additions and 12 deletions

View File

@ -6,19 +6,18 @@ import globals
def howl(username: str) -> str: def howl(username: str) -> str:
""" """
Return a random howl message (0-100). Generates a howl response based on a random percentage.
- If 0%: a fail message. Uses a dictionary to allow flexible, randomized responses.
- If 100%: a perfect success.
- Otherwise: normal message with the random %.
""" """
howl_percentage = random.randint(0, 100) howl_percentage = random.randint(0, 100)
if howl_percentage == 0: # Round percentage down to nearest 10 (except 0 and 100)
return f"Uh oh, {username} failed with a miserable 0% howl ..." rounded_percentage = 0 if howl_percentage == 0 else 100 if howl_percentage == 100 else (howl_percentage // 10) * 10
elif howl_percentage == 100:
return f"Wow, {username} performed a perfect 100% howl!" # Fetch a random response from the dictionary
else: response = utility.get_random_reply("howl_replies", str(rounded_percentage), username=username, howl_percentage=howl_percentage)
return f"{username} howled at {howl_percentage}%!"
return response
def ping() -> str: def ping() -> str:
""" """

View File

@ -0,0 +1,79 @@
{
"0": [
"Uh oh, {username} failed with a miserable {howl_percentage}% howl ...",
"Yikes, {username}'s howl didn't even register. A complete failure!",
"{username} tried to howl, but it came out as a pathetic whisper...",
"Not a single sound from {username}... {howl_percentage}% howl detected!",
"{username} choked on their howl and ended up coughing instead!"
],
"10": [
"{username} let out a weak {howl_percentage}% howl... barely noticeable.",
"{username} howled at {howl_percentage}%, but it sounded more like a sigh.",
"That {howl_percentage}% howl was more of a breath than a call, {username}...",
"{username} tried to howl at {howl_percentage}%, but the wind drowned it out.",
"A faint {howl_percentage}% howl from {username}. A whisper in the night!"
],
"20": [
"{username} howled at {howl_percentage}%! Not great, but not silent!",
"A shaky {howl_percentage}% howl from {username}. At least it's audible!",
"That {howl_percentage}% howl had some spirit, {username}!",
"{username} let out a {howl_percentage}% howl. Could use more power!",
"At {howl_percentage}%, {username}'s howl barely stirred the trees."
],
"30": [
"{username} howled at {howl_percentage}%! A decent attempt!",
"A soft but clear {howl_percentage}% howl from {username}.",
"{username} gave a {howl_percentage}% howl! The wolves tilt their heads.",
"That {howl_percentage}% howl had some potential, {username}!",
"{username}'s {howl_percentage}% howl echoed weakly, but it carried."
],
"40": [
"{username} howled at {howl_percentage}%! Getting a bit of force behind it!",
"A sturdy {howl_percentage}% howl from {username}. The pack listens.",
"{username}'s {howl_percentage}% howl carried through the trees.",
"That {howl_percentage}% howl had some presence! Not bad, {username}.",
"A respectable {howl_percentage}% howl from {username}! Almost strong."
],
"50": [
"A solid {howl_percentage}% howl from {username}! Right in the middle of the scale!",
"{username} let out a {howl_percentage}% howl. Steady and clear.",
"{username}'s {howl_percentage}% howl echoed nicely into the night.",
"That {howl_percentage}% howl had a good ring to it, {username}!",
"{username} howled at {howl_percentage}%, solid but not overwhelming."
],
"60": [
"{username} howled at {howl_percentage}%! A strong and steady call!",
"That {howl_percentage}% howl had some real strength behind it, {username}!",
"A deep {howl_percentage}% howl from {username}, heard from afar!",
"{username} howled at {howl_percentage}%, and the night air carried it far!",
"That {howl_percentage}% howl had a great tone, {username}!"
],
"70": [
"{username} howled at {howl_percentage}%! A bold, commanding call!",
"That {howl_percentage}% howl from {username} had serious power!",
"{username}'s howl at {howl_percentage}% sent a chill through the air!",
"A howling force at {howl_percentage}%! {username} is getting loud!",
"{username} let out a {howl_percentage}% howl! The pack takes notice."
],
"80": [
"{username} howled at {howl_percentage}%! That was a proper call!",
"A mighty {howl_percentage}% howl from {username}! The wolves approve!",
"At {howl_percentage}%, {username}'s howl rang through the valley!",
"{username} let out an {howl_percentage}% howl! Strong and proud!",
"That {howl_percentage}% howl had real weight to it, {username}!"
],
"90": [
"{username} howled at {howl_percentage}%! Almost a perfect call!",
"A thunderous {howl_percentage}% howl from {username}! Almost legendary!",
"That {howl_percentage}% howl from {username} shook the trees!",
"{username} let out a {howl_percentage}% howl! Nearly flawless!",
"That {howl_percentage}% howl was near perfection, {username}!"
],
"100": [
"Wow, {username} performed a perfect {howl_percentage}% howl!",
"A magnificent howl! {username} reached a legendary {howl_percentage}%!",
"{username}'s howl echoed through the mountains at a flawless {howl_percentage}%!",
"The wolves bow before {username}, whose {howl_percentage}% howl was unmatched!",
"Perfect pitch, perfect strength—{username} unleashed a {howl_percentage}% howl!"
]
}

View File

@ -17,7 +17,7 @@
"commands": { "commands": {
"hi": { "hi": {
"min_role": "", "min_role": "",
"allowed_roles": [], "allowed_roles": ["broadcaster", "owner"],
"allowed_users": ["203190147582394369"] "allowed_users": ["203190147582394369"]
} }
} }