Class OpenTriviaDbService
Inheritance
System.Object
OpenTriviaDbService
Namespace: CommonBotLibrary.Services
Assembly: cs.temp.dll.dll
Syntax
public class OpenTriviaDbService : ITriviaService
Methods
GetTriviaAsync(Int32, Category, Nullable<Difficulty>, Nullable<Type>)
Searches opentdb.com for trivia.
Declaration
public Task<IEnumerable<OpenTriviaDbResult>> GetTriviaAsync(int amount = 50, Category cat = null, Difficulty? diff = null, Type? type = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | amount | The amount of results to retrieve (1 to 50). |
| Category | cat | The category of questions to retrieve. |
| System.Nullable<Difficulty> | diff | The difficulty of questions to retrieve. |
| System.Nullable<Type> | type | The type of questions to retrieve. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<OpenTriviaDbResult>> | A collection of relevant trivia. |