From d170c9136012fa86ee4a97e73051601d0efa917f Mon Sep 17 00:00:00 2001 From: Naomi Carrigan Date: Sat, 16 Aug 2025 15:10:50 -0700 Subject: [PATCH] feat: improve responses, better rng --- src/config/reminders.ts | 150 ++++++++++++++++++++++++++---------- src/modules/checkAltText.ts | 2 +- src/utils/getRandomValue.ts | 4 +- 3 files changed, 114 insertions(+), 42 deletions(-) diff --git a/src/config/reminders.ts b/src/config/reminders.ts index f8f276a..af97817 100644 --- a/src/config/reminders.ts +++ b/src/config/reminders.ts @@ -6,44 +6,114 @@ /* eslint-disable stylistic/max-len -- there will be some long strings in here. */ -export const reminders = [ - "Psst~ I noticed your image doesn’t have alt-text! Could you please add one so everyone can enjoy it? 🌸", - "UwU~ don’t forget to add alt-text so our visually impaired friends can experience your post too! ✨", - "Heehee~ your image is lovely, but it would be even better with alt-text so everyone can appreciate it~ 💖", - "Altaria-chan here! Please add a short description for your image so nobody feels left out~ 🌈", - "Hmm… I think you forgot your alt-text! Could you add one so the whole server can enjoy your upload? 💕", - "Eep~ your post is missing alt-text! Let’s make it extra accessible together, okay? 🌟", - "Nyah~ alt-text makes sure *everyone* can experience your image! Could you add some? 🐾", - "Just a gentle reminder, sweetie~ images shine brighter when they have alt-text~ ✨", - "Altaria-chan believes in inclusive posting! Could you add a description to your image, pwease? 💌", - "Hehe~ let’s make your post purrfect by adding some alt-text so everyone can enjoy it~ 🐱", - "Ahem~ Altaria reporting in! Your image could use a sprinkle of alt-text magic~ 🪄", - "Oh! I think your picture is missing its story~ could you add some alt-text so everyone can see it? 📜", - "Mmm~ adding alt-text is like adding seasoning to a meal—it makes it better for everyone! 🍲", - "Kyaa~ your post is cute, but with alt-text it can be *inclusive* too! 💗", - "Tehee~ accessibility is love~ could you add some alt-text so all can share in it? 🌷", - "Poyo~ alt-text makes sure no one feels left out of the fun! Can you add some? 🥺", - "O-oh! You forgot your alt-text… w-wanna fix that together? 💞", - "Mofu mofu~ adding alt-text makes your post extra snuggly for everyone~ 🐑", - "Your art/photo deserves to be enjoyed by everyone~ let’s give it some alt-text magic! ✨", - "Yatta~ we can make your post perfect with just one thing… alt-text! 💎", - "Altaria thinks alt-text is the secret ingredient for kindness online~ 🍪", - "Could you help me out by adding alt-text to that image, sweetie? 💖", - "Ooh~ I can’t read images without alt-text… could you describe it for me? 📚", - "Nyaa~ alt-text helps make our community pawsitively inclusive! 🐾", - "Adding alt-text is like giving your image a warm hug~ please add some~ 🤗", - "Mmm! With alt-text, your post will be as beautiful in words as it is in sight~ 🌺", - "Altaria’s tip of the day~ alt-text helps everyone experience the joy in your post! 🌞", - "Could you add alt-text for me? I promise it’ll make your post sparkle~ ✨", - "Don’t forget, cutie~ alt-text is how we share the beauty of our images with *everyone*~ 💌", - "Adding alt-text shows you care~ could you add some to your upload? 🌹", - "Altaria’s little birdy heart sings when people use alt-text~ 🐦", - "Let’s make sure no one misses out! Add some alt-text, please? 🥰", - "Huggles~ alt-text makes the internet cozier for everyone~ 🧸", - "Oopsie~ your post is missing alt-text! Wanna fix it together? 💕", - "Mmm~ words paint pictures too~ let’s add some to your image~ 🎨", - "Pwease add alt-text so everyone can feel included, nya~ 🐱", - "Altaria believes accessibility is beautiful~ can you add some alt-text to help? 💖", - "Don’t forget to give your image its voice with alt-text~ 🎤", - "The best posts are the ones *everyone* can enjoy~ could you add alt-text? 🌼", +const altariaReminders = [ + // 🌸 Gentle encouragement (20) + "Next time, give your image a tiny description—it helps everyone feel included~ 💖", + "A quick alt-text on your next post will make your image bloom for all to see~ 🌸", + "Future uploads shine brightest when paired with a little description~ ✨", + "Don’t forget: words can carry your picture further next time~ 🌈", + "Your next post will be even more magical with alt-text sprinkled in~ 🪄", + "Adding just a few words next time can open your image to more hearts~ 💕", + "Alt-text is like a gentle breeze—it makes your future posts feel lighter~ 🍃", + "Your image is beautiful; with alt-text next time, it will be unforgettable~ 🌺", + "Every alt-text is a candle that lights the way—please bring one next post~ 🕯️", + "A sprinkle of description next time will make your art bloom brighter~ 🌼", + "Your kindness shines through words—add some alt-text next upload~ 🌟", + "Next post, a little caption will carry your image to every viewer~ 📖", + "Remember: even a small note next time makes your post inclusive~ ✉️", + "Future images will feel warmer with alt-text wrapped around them~ 🔆", + "Your next picture deserves a story—please add alt-text to tell it~ 📚", + "Alt-text is like sunshine—it helps your posts grow stronger~ 🌞", + "A little love note as alt-text will brighten your next upload~ 💌", + "Future posts sparkle brightest when shared with words, too~ ✨", + "Your images sing louder when they have alt-text lyrics~ 🎶", + "Let’s give your next picture a gentle voice with alt-text~ 🎤", + + // 🌟 Playful / cute (20) + "Nyaa~ next time let’s give your image a caption so everyone can meow along~ 🐾", + "Hehe~ your picture was cute, but your next one can sparkle extra with alt-text~ 🌟", + "Altaria loves seeing your images—let’s add words next time so everyone can too! 💕", + "UwU~ alt-text is like sprinkles on ice cream… please add some next time~ 🍨", + "Poyo! Don’t forget alt-text on your next post—it makes the internet softer~ 🐣", + "Nyoho~ your next upload will be 10x cuter with a lil alt-text hug~ 🧸", + "Altaria’s tail wags when posts have alt-text—don’t forget next time~ 🐕", + "Heehee~ let’s dress your next image in words—it’s like a fashion accessory~ 👗", + "Kyaa~ next post can sparkle twice: once in pixels, once in words~ ✨", + "Alt-text is the confetti to your image’s party—add some next time~ 🎉", + "Meep! Your next upload will taste sweeter with alt-text sugar~ 🍭", + "Adding alt-text is like giving your post bunny ears—adorable! 🐰", + "Next time, please sprinkle words like stardust on your image~ 🌌", + "Nyan~ Altaria thinks alt-text makes every upload extra paw-some~ 🐱", + "Uwuu~ don’t leave me guessing next time, add alt-text for hugs~ 🤗", + "Your next image can sparkle like magical girl power—with alt-text~ 🌙", + "Hehe~ posts with alt-text feel like mochi—soft and sweet~ 🍡", + "Don’t forget, senpai~ words are cuddles too! Please add alt-text next time~ 💕", + "Alt-text is like catnip for accessibility—your next post will love it~ 🐾", + "Add a sprinkle of word magic next upload so Altaria can uwu properly~ ✨", + + // 📚 Educational (20) + "Fun fact: alt-text helps screen readers describe images! Please add some next time~ 📖", + "Accessibility tip~ keep your next alt-text short, clear, and sweet~ 🍬", + "Alt-text makes images readable by assistive tech—don’t forget it on your next post~ 🖥️", + "Your future posts will reach *everyone* with just a few words of alt-text~ 🌍", + "Screen readers can’t see images, but they love when you add text! Try it next time~ 👓", + "Alt-text is usually best at 1–2 sentences—perfect for your next upload~ 📝", + "Future posts with alt-text help people scrolling fast to understand quickly~ ⏩", + "Alt-text is read aloud by devices—your words bring pictures to life! 📱", + "Adding alt-text is like subtitles for your image—please add it next time~ 🎬", + "Next upload, describe colors, people, or actions—it helps so much~ 🎨", + "Alt-text isn’t just kindness—it’s usability! Please include it next time~ 🛠️", + "Assistive tech translates alt-text into sound—be their narrator next time~ 🎤", + "Alt-text matters even for memes—your words keep the joke alive~ 😂", + "Future posts with alt-text = fewer barriers and more smiles~ 🌟", + "Altaria fact: clear alt-text is better than long alt-text—try concise next time~ ✂️", + "Alt-text ensures your art is remembered beyond the visuals~ 🖌️", + "Think of alt-text as metadata powered by kindness—please use it next time~ 🗂️", + "Alt-text is like seasoning—too little and flavor is missing, too much overwhelms~ 🌶️", + "Next time you post, add alt-text to give blind users the full experience~ 🧏", + "Words matter—alt-text transforms silence into a story. Please add it next upload~ 📚", + + // 💌 Community vibes (20) + "Together we can keep this server inclusive—please add alt-text next time~ 🤝", + "Our community shines when images have descriptions—don’t forget next time~ ✨", + "Every alt-text you add makes this space more welcoming~ keep it up for your next post~ 💞", + "Next upload, let’s include alt-text so no one is left out of the fun~ 🎉", + "Your kindness shows when you add alt-text—let’s remember it next time~ 🌹", + "Accessibility is teamwork—alt-text on your next post helps us all~ ⚽", + "Future uploads with alt-text help everyone share the joy~ 💐", + "Altaria cheers every time alt-text appears—let’s make her cheer again next time~ 📣", + "Our server is cozy when posts have alt-text—add it next time~ 🏡", + "Your alt-text makes our community stronger—please include it in your next share~ 💪", + "Every description builds a bridge—add one next time so all can cross~ 🌉", + "Future posts with alt-text weave the net tighter—so no one falls through~ 🕸️", + "We’re all in this together—please add alt-text for your next upload~ 🫂", + "Accessibility makes the party bigger—add alt-text next time so all can join~ 🎈", + "Next post, alt-text will help more friends laugh, smile, or feel moved~ 😊", + "Our community glows brighter with every alt-text addition~ 🌟", + "Your next post can be the example others follow—show alt-text love~ 💕", + "Inclusivity grows when you add alt-text—let’s plant more next time~ 🌱", + "Altaria’s heart sings when the community cares—don’t forget alt-text next time~ 🎵", + "Every alt-text is a high five to inclusivity—add one next upload~ 🙌", + + // 🎭 Thematic / fantasy (20) + "Your picture cast a spell—next time, alt-text can be the incantation everyone hears~ 🔮", + "Altaria the bard says: give your next image its song with a short description~ 🎶", + "A hero’s tale needs words—please add alt-text on your next quest post~ ⚔️", + "Your image was like a treasure chest—next time, alt-text is the key that opens it~ 🗝️", + "Future uploads will sparkle brighter with the magic of alt-text~ ✨", + "Altaria the mage whispers: next time, bind your image with the spell of words~ 📜", + "Your next post can be a constellation—alt-text is the starlight that connects it~ 🌌", + "Knights protect with swords—heroes protect with alt-text! ⚔️", + "Next upload, be the storyteller—let alt-text be your legend~ 📖", + "Every picture is a potion—alt-text is the label that saves the adventurer~ 🧪", + "Future uploads are quests—alt-text is the map that guides others~ 🗺️", + "Dragons hoard gold, but true treasure is alt-text in your next post~ 🐉", + "Altaria the oracle foresees your next upload shining with alt-text~ 🔮", + "Your next picture can be a fairytale—alt-text is the narration~ 📚", + "Elves sing of kindness—add alt-text next time to join their song~ 🎵", + "Next time, alt-text will be your magic ring of inclusivity~ 💍", + "Altaria the healer says: alt-text cures exclusion—add it next post~ 💊", + "Every hero leaves runes behind—yours can be alt-text next upload~ 🔤", + "Next time, alt-text will be your enchanted shield of accessibility~ 🛡️", + "Let your image fly on dragon wings—alt-text is the wind beneath them~ 🌬️", ]; diff --git a/src/modules/checkAltText.ts b/src/modules/checkAltText.ts index 991ef2f..664caee 100644 --- a/src/modules/checkAltText.ts +++ b/src/modules/checkAltText.ts @@ -28,7 +28,7 @@ export const checkAltText = async(message: Message): Promise => { if (noDescription.size > 0) { const reminder = getRandomValue(reminders); await message.reply({ - content: `${reminder}\n-# If you do not know how to do this, check [Discord's help article]()!`, + content: `${reminder}\n-# If you do not know how to do this, check [Discord's help article]()!\n-# Need help writing descriptive text? Our bot [Cordelia]() can do it for you!`, }).catch(() => { return null; }); diff --git a/src/utils/getRandomValue.ts b/src/utils/getRandomValue.ts index bd9574c..6cb6c9a 100644 --- a/src/utils/getRandomValue.ts +++ b/src/utils/getRandomValue.ts @@ -4,6 +4,8 @@ * @author Naomi Carrigan */ +import { randomInt } from "node:crypto"; + /** * Returns a random value from the provided array. * @template T - The type of the elements in the array. @@ -11,7 +13,7 @@ * @returns A random value from the array. */ export const getRandomValue = (array: Array): T => { - const randomIndex = Math.floor(Math.random() * array.length); + const randomIndex = randomInt(0, array.length); // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- We know the array is not empty. return array[randomIndex] as T; };