Hello!
Actually I am doing a trivia game and want to filter the question to not show a repeated one. Are there an option to receive the question ID to save that and don’t show the question to the user?
What you want to use to solve this is called a session token. Using a session token will ensure you don’t get the same question repeated.
Session Tokens are unique keys that will help keep track of the questions the API has already retrieved. By appending a Session Token to a API Call, the API will never give you the same question twice. Over the lifespan of a Session Token, there will eventually reach a point where you have exhausted all the possible questions in the database. At this point, the API will respond with the approperate “Response Code”. From here, you can either “Reset” the Token, which will wipe all past memory, or you can ask for a new one.
You can read more about how session tokens work here:
I think about a long time user, to not make point just decorating the question
OK, so you’re obviously not a native English speaker, so I’m just chiming in to let you know that that made absolutely no sense. You’re likely going to have to rephrase that.
I don’t think session tokens persist over multiple uses, but maybe you can store it and reuse it later. If that doesn’t work, you will likely need to come up with your own storage solution. You might be able to get away with using a dictionary or a hash table to save them using the question string itself, but I wouldn’t know what the best approach is.
Hi… I’ve got the same issue! I’m creating a Discord Trivia Bot that uses OpenTB as one of its sources. Much like you can query category for ID… I’d love to be able to get the question ID returned as well. I have a workaround where I store an offline database and check for duplicates.