Sends a Question of the Day every day at a specific time. It pins the QOTD in said channel and unpins the previous QOTD. You may change the time/frequency by editing the endpoint. Just enter your channel_id int the channel environment variable, and your bot name in the botname environment variable. Enjoy!
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
const KEY = `questions_current_index`; //keyvalue key
//array of questions for the bot to choose from
const array = [
`Is a hotdog a sandwich? Why or why not?`,
`Do you like things that are "so bad it's good?" What's your favorite example of it?`,
`What is something you can never seem to finish?`,
`What silly or funny thing are you afraid of?`,
`What has taken you the longest to get good or decent at?`,
`If you have 30 minutes to kill before going somewhere, what do you do?`,
`What is the worst tasting thing you have ever eaten?`,
`If you had to lose one of your senses, which would you choose to lose?`,
`What do you wish your phone could do?`, `What workers have the worst jobs?`,
`What song is stuck in your head right now?`,
`If the internet suddenly stopped existing, what would you do with the time you used to spend on it?`,
`What's the longest trip you've been on?`,
`What's something you tried that you didn't think you would like, but you ended up really liking?`,
`If you could have a never-ending candle that smelled like anything you wanted, what fragrance would you want it to be?`,
`What's your "usual" from your favorite fast food place?`,
`If you didn't have to sleep, what would you do with the extra time?`,
`If you could turn any activity into an Olympic sport, what would you have a good chance at winning a medal for?`,
`If someone came up to you and said "Hey, do that thing you do!", what thing would pop into your head first?`,
`You're being interrogated and so far you've held strong. What song do they play on repeat that breaks you?`,
`What bit of trivia do you know that is very interesting but also very useless?`,
`What word or saying from the past do you think needs to make a comeback?`,
`What do you like to collect?`,
`What's your favorite color and favorite thing that is that color?`,
`What is something you learned in the last week?`,
`What's the most annoying machine you must deal with regularly?`,
`What kind of business would you like to start if you were given the chance?`,
`What food is underrated or underappreciated?`,
`You have your own late-night talk show, who do you invite as your first guest?`,
`Would you rather be transported permanently 500 years into the future or 500 years into the past?`,
`If you could create your own job title, what would it be?`,
`What's your favorite "Life Pro Tip"?`,
`You're going to sail around the world, what's the name of your boat?`,
`What do you usually do on your commute?`,
`If you could get an exotic pet, any animal at all, what kind of companion would you like to have?`,
`If you could control any of the four elements (earth, water, air, and fire), which would you choose and why?`,
`What caused you to feel nostalgia recently?`, `If you were given 500 acres of land, what would you use it for?`,
`What is something you are utterly obsessed with at the moment?`,
`What's your favorite fruit?`,
`What is your favorite junk food?`,
`What is your most used emoji?`,
`What are you interested in that most people haven't heard of?`,
`What would be some of the downsides of certain superpowers?`,
`If you could slow down time, what would you do with that power?`,
`What movie, picture, or video always makes you laugh no matter how often you watch it?`,
`If you could get anything you wanted for free from one store the rest of your life, what would it be?`,
`What catchy jingle or bit of advertising has stuck with you?`,
`What would you choose as the 8th wonder of the world?`,
`What is the best excuse for being late you've heard or used?`,
`If you received a salary to follow whatever passion you wanted to, what would you do?`,
`What natural landmark would you like to see someday?`,
`What recent trend are you totally on board with?`,
`If your job gave you a surprise three day paid break to rest and recuperate, what would you do with those three days?`,
`What was cool when you were young but isn't cool now?`,
`If you could snap your fingers and learn a language, what language would you learn?`,
`What current trend do you hope will go on for a long time?`,
`If you could level up in life just like in video games, where would you put your next skill point?`,
`What app can you not believe someone hasn't made yet?`,
`What kind of art do you appreciate the most?`,
`In what situations, do you wish you could throw down a smoke bomb and disappear?`,
`Are you a cat person, dog person, both, or neither?`,
`If you had to leave your country permanently, where would you relocate to?`,
`What three objects do you value the most?`,
`You can only have one food condiment for the rest of your life, which do you choose?`,
`Do you prefer pens or pencils? Why?`,
`If you could change one plotline of a piece of fiction, which would it be and why?`,
`What hobby would you get into if time and money weren't an issue?`,
`What place or activity do you find relaxing?`,
`What is your favorite plant or flower?`,
`What do you get every time you go grocery shopping?`,
`If you could use magic to do one mundane task for the rest of your life, what would it be?`,
`If you had unlimited funds to build a house that you would live in for the rest of your life, what would the finished house be like?`,
`What product would you seriously stockpile if you found out they weren't going to sell it anymore?`,
`What is something popular now, but in 5 years everyone will look back on and be embarrassed they liked it?`,
`Would you rather only be able to use a fork (no spoon) or only be able to use a spoon (no fork)?`,
`What is your favorite holiday tradition?`,
`What's the most interesting documentary you've ever watched?`,
`What takes a lot of time but is totally worth it?`,
`If the universe is just a simulation, what update or patch does it need?`,
`If you see a puddle on the ground, do you walk around it, over it, or through it?`,
`If life is a game like some people say, what are some of the rules?`,
`What could you give a 40-minute presentation on with absolutely no preparation?`,
`If you were a wrestler what would be your entrance theme song?`,
`What music do you put on when you want to get pumped?`,
`When you were younger, what did you think would be awesome about being older, but isn't as awesome as you thought it would be?`,
`What's the most useless talent you have?`,
`What's your favorite video game console and game or series on that console?`,
`What's the most interesting thing you've seen online this week?`,
`What were the silliest things you believed as a child?`,
`What do you greatly enjoy doing but wish you could do more?`,
`If you could see one movie again for the first time, what would it be and why?`,
`What website do you visit most often?`,
`What fictional item do you wish you owned in real life?`,
`What is the farthest you have ever been from where you were born?`,
`Do you have any weird superstitions?`,
`What chore do you absolutely hate doing?`,
`What's your current earbug (song that your mind can't seem to get off replay)?`,
`You have a match in a pitch-dark room with a candle, a wood stove and a gas lamp. Other than the match, which do you light first?`,
`What is your favorite life hack?`,
`How many "chuggas" are you supposed to say before "choo choo"?`,
`In what situation or place would you feel the most out of place in?`,
`What does your perfect breakfast look like?`,
`What should they teach in high school but don't?`,
`What item has drastically improved your life?`,
`Where or what do you not mind waiting for?`,
`Do you ever remember your dreams? Have you had any weird ones that stuck with you?`,
`What's one fact about the universe that blows your mind?`,
`What is your favorite summer activity?`,
`Do you pour the milk in before the cereal, or the cereal before the milk?`,
`What place would you first travel to if you could teleport?`,
`Sock sock shoe shoe or sock shoe sock shoe?`,
`What are some things that are okay to occasionally do but not okay to do every day?`,
`How do you usually get your news?`,
`If you had a year of free time to learn or hone any skill, what would you do?`,
`What's the most unique shop or restaurant you've been in?`,
`When things break, do you prefer to fix them or replace them?`,
`What's your favorite subject in school? What's your least favorite?`,
`What's your favorite accessory or clothing item?`,
`You have to sing karaoke, what song do you pick?`,
`What did your teachers and parents say would be important when you grew up, but hasn't been?`,
`What habit do you find yourself doing without thinking?`,
`You have 5 minutes, what's the best drawing (hand drawn or digital) you can make?`,
`What's something that was once important but is now becoming less and less relevant?`,
`What kitchen tool or appliance do you find especially useful?`,
`Do you prefer headphones or earbuds?`,
`What is your favorite ethnic or family dish?`,
`What happens in real life but rarely gets portrayed in movies?`,
`Would you rather be able to breathe underwater or have the agility of a cat?`,
`If you had to bury a treasure chest, where would you hide it?`,
`If you could bring back any fashion trend what would it be?`,
`Have you ever experienced something supernatural?`,
`What is something that most people consider to be a luxury, but you don't think you could live without?`,
`What is the nicest surprise or favor someone has done for you?`,
`What was your least favorite food as a child? Do you still hate it or have you grown to like it?`,
`Would you rather never use social media again, or never watch another movie / TV show again?`,
`Do you enjoy spicy food? What's the spiciest thing you've ever eaten?`,
`Are you more of an early bird or a night owl?`,
`If you could be on any game show, which one would it be?`,
`How do you feel about putting pineapple on pizza?`,
`What's the longest line you've ever waited in? Was it worth it?`,
`What kinds of things do you like to cook or are good at cooking?`,
`What invention doesn't get a lot of love, but has greatly improved the world?`,
`What would be some of the most annoying things about having yourself as a roommate?`,
`What's a series that hasn't been updated in a while that you'd love to see revived?`,
`What's the best food for a food fight?`,
`Would you rather there be a ding sound every time you wink or a cartoonish gun sound when you make a finger gun?`,
`What's something that a lot of people are missing out on because they don't know about it?`,
`What food have you never eaten but would really like to try?`,
`What was the scariest movie you've seen?`,
`What sort of terrain would you thrive best in? The beach? The mountains? The desert?`,
`Would you rather never age physically or never age mentally?`,
`What would a world populated by clones of you be like?`,
`What words do you consistently spell wrong no matter how hard you try?`,
`What's something inexpensive that holds a lot of sentimental value to you?`,
`If you were transported 400 years into the past with no belongings, how would you prove that you were from the future?`,
`What was the last thing you read about, digitally or in print, that you found interesting?`,
`If you could know the absolute and total truth to one question, what question would you ask?`,
`Have you ever been told you look like someone famous, who was it?`,
`What animal or plant do you think should be renamed?`,
`What is the most annoying habit that other people have?`,
`What wastes the most time in your day to day life?`,
`What happened this week that made you happy?`,
`What's something you do differently than most other people?`,
`What game have you spent the most hours playing?`,
`What's your favorite thing about the area you live in?`,
`What improved your life quality so much, you wish you did it sooner?`,
`What movie would be greatly improved if it was made into a musical?`,
`When someone finds out what you do, or where you are from, what question do they always ask you?`,
`What's one thing that gets far too much coverage on the news?`,
`What incredibly common thing have you never done?`,
`Would you rather not be able to open any closed doors (locked or unlocked) or not be able to close any open doors?`,
`What show have you been watching lately?`,
`What piece of entertainment do you wish you could erase from your mind so that you could experience it for the first time again?`,
`Do you like coffee or tea? What kind do you prefer?`,
`What song is a 10/10, yet hardly anyone has heard of it?`,
`What recent scientific discovery blows your mind?`,
`If you were put into solitary confinement for six months, what would you do to stay sane?`,
`What movie completely changes its plot when you change one letter in its title? What's the new movie about?`,
`What's the story behind your username?`,
`What items do you carry with you every day?`,
`What's something you tried really hard to like but couldn't?`,
`If you could have an unlimited supply of one thing for the rest of your life, what would it be?`,
`If there was a zombie apocalypse tomorrow, what is the first thing you would do?`,
`What is your favorite quote?`,
`What frivolous thing do you have a strong opinion about? For example, the correct way to hang toilet paper is "over".`,
`If magic was real, what spell would you try to learn first?`,
`If you could only eat one food for the rest of your life, what would it be?`,
`What weird food combinations do you really enjoy?`,
`What task did you complete this week that made you feel accomplished?`,
`What's one thing that puzzles you every time you think about it?`,
`What's your favorite conspiracy theory?`,
`Can you name two or more different songs that share the same title?`,
`What age do you wish you could permanently be?`,
`What's worth spending more on to get the best?`,
`Who is your favorite superhero? Who is your favorite villain?`,
`What is the best and worst purchases you've ever made?`,
`What are some red flags to watch out for in daily life?`,
`What card or board games do you like to play?`,
`You're going on a road trip! What two items do you make sure to bring with you?`,
`What job do you think you'd be really good at?`,
`What's your favorite kind of dessert?`,
`What's your drink of choice (alcoholic or non)?`,
`What's your favorite ice cream topping?`,
`What upcoming media (movie, show, game, etc.) are you most looking forward to?`,
`What's your favorite sandwich? What do you like to put on it?`,
`What is your favorite TV theme song?`,
]
let channel_id = `${process.env.channel}`//your channel_id
let message_id = await lib.utils.kv['@0.1.16'].get({
key: `qotd_message_id`
});
if (!message_id) {
let currentIndex = await lib.keyvalue.store['@0.1.16'].get({
key: `${KEY}`,
defaultValue: 0
});
if(currentIndex > array.length) currentIndex = 0;
const question = array[currentIndex];
//creates a date for the footer message
const d = new Date();
const now = d.toLocaleString("en-US", {timeZone: "America/Chicago"});
let message = await lib.discord.channels['@0.2.0'].messages.create({
channel_id: `${channel_id}`,//your channel_id
content: ``,
embed: {
title: `Question of the Day!:`,
description: `${question}`,
color: 0xffc0cb, // may be changed
footer: {
text:`${process.env.botname} • Today at ${now} CST`,//your botname and todays date/time
},
},
});
await lib.utils.kv['@0.1.16'].set({
key: `qotd_message_id`,
value: `${message.id}`
});
await lib.discord.channels['@0.3.2'].pins.create({
message_id: message.id,
channel_id: `${channel_id}`,
});
let nextIndex = currentIndex + 1;
await lib.keyvalue.store['@0.1.16'].set({
key: `${KEY}`,
value: nextIndex
});
}
if (message_id) {
await lib.discord.channels['@0.3.2'].pins.destroy({
message_id: `${message_id}`,
channel_id: `${channel_id}`
});
await lib.utils.kv['@0.1.16'].clear({
key: `qotd_channel`
});
let currentIndex = await lib.keyvalue.store['@0.1.16'].get({
key: `${KEY}`,
defaultValue: 0
});
if(currentIndex > array.length) currentIndex = 0;
const question = array[currentIndex];
//creates a date for the footer message
const d = new Date();
const now = d.toLocaleString("en-US", {timeZone: "America/Chicago"});
let message = await lib.discord.channels['@0.2.0'].messages.create({
channel_id: `${channel_id}`,//your channel_id
content: ``,
embed: {
title: `Question of the Day!:`,
description: `${question}`,
color: 0xffc0cb, // may be changed
footer: {
text:`${process.env.botname} • Today at ${now} CST`,//your botname and todays date/time
},
},
});
await lib.utils.kv['@0.1.16'].set({
key: `qotd_message_id`,
value: `${message.id}`
});
await lib.discord.channels['@0.3.2'].pins.create({
message_id: message.id,
channel_id: `${channel_id}`,
});
let nextIndex = currentIndex + 1;
await lib.keyvalue.store['@0.1.16'].set({
key: `${KEY}`,
value: nextIndex
});
}