I’m a mod for a Twitch Streamer using Nightbot. We currently have a !funfacts command (with custom facts) which fetches a random option from a Raw PasteBin spreadsheet when the command is used.
Are you asking for a command that allows the user to search up a certain fact using an index number? Maybe using keyword(s)? If so, case-insensitive or case-sensitive search? Do you want Nightbot to return the first fact that contains the keyword? All facts that contain it? One random fact out of all of those that contain it?
Say if I put in the command “!Fact22” Nightbot would pull Fact 22 from the list and put it in chat “Fun Fact 22: A pregnant goldfish is called a twit.”
I set up a command called !fact that will output a random fact if there’s no input and output a certain fact if the input has a number index. I also added an error output if the input is not a positive integer smaller than the number of facts in your paste. Copy and paste this into your chat: