The Discord data provider class.
More...
#include <DiscordDataProvider.qc.dox.h>
|
| constructor (*hash< auto > options) |
| Creates the object from constructor options.
|
|
| constructor (DiscordRestClient rest) |
| Creates the object from a DiscordRestClient.
|
|
| constructor (DiscordRestConnection conn) |
| Creates the object from a DiscordRestClient.
|
|
*list< hash< DataProvider::DataProviderSummaryInfo > > | getChildProviderSummaryInfo () |
| Return data provider summary info.
|
|
*string | getDesc () |
| Returns the data provider description.
|
|
string | getName () |
| Returns the data provider name.
|
|
| constructor () |
| Creates the object.
|
|
| constructor (DiscordRestClient rest, *Logger::LoggerInterface logger) |
| Creates the object.
|
|
| constructor (DiscordRestConnection conn, *Logger::LoggerInterface logger) |
| Creates the object.
|
|
| setLogger (*LoggerInterface logger) |
| Accepts a LoggerInterface object for logging (or clears it)
|
|
|
static DiscordRestClient::DiscordRestClient | getRestConnection (*hash< auto > options) |
| Returns a DiscordRestClient connection from the options.
|
|
static | registerChild (string name, code generator) |
| Registers a child data provider.
|
|
static | threadWait (date wait_period) |
| Wait for a given period of time.
|
|
|
const | ConstructorOptions = ... |
| Constructor options.
|
|
const | MaxIoRetries = 5 |
| Max retries.
|
|
const | RetrySet = ... |
| IO errors for REST retries.
|
|
|
static hash< DataProviderInfo > | ProviderInfo |
| Provider info.
|
|
|
*DataProvider::AbstractDataProvider | getChildProviderImpl (string name) |
| Returns the given child provider or nothing if the given child is unknown.
|
|
*list< string > | getChildProviderNamesImpl () |
| Returns a list of child data provider names, if any.
|
|
hash< DataProvider::DataProviderInfo > | getStaticInfoImpl () |
| Returns data provider static info.
|
|
hash< auto > | doRestCommand (string method, string path, auto body, reference< hash< auto > > info) |
| Makes a REST call and returns the response; handles rate limit responses.
|
|
hash< auto > | getGuild (string id) |
| Retrieves info for the given guild; must be accessible to the calling user.
|
|
bool | retry (hash< ExceptionInfo > ex, reference< int > retries) |
| Returns True if the error indicates that the operation should be retried.
|
|
|
*DiscordRestConnection | conn |
| The connection object used to create the REST client.
|
|
*DiscordRestClient | rest |
| The REST client object for API calls.
|
|
The Discord data provider class.
◆ getChildProviderImpl()
*DataProvider::AbstractDataProvider DiscordDataProvider::DiscordDataProvider::getChildProviderImpl |
( |
string | name | ) |
|
|
protected |
Returns the given child provider or nothing if the given child is unknown.
- Returns
- the given child provider or nothing if the given child is unknown
- See also
- getChildProviderEx()
◆ getChildProviderNamesImpl()
*list< string > DiscordDataProvider::DiscordDataProvider::getChildProviderNamesImpl |
( |
| ) |
|
|
protected |
Returns a list of child data provider names, if any.
- Returns
- a list of child data provider names, if any
◆ registerChild()
static DiscordDataProvider::DiscordDataProvider::registerChild |
( |
string | name, |
|
|
code | generator ) |
|
static |
Registers a child data provider.
- Parameters
-
name | the child's name |
generator | code to generate the child; prototype: sub (string name, AbstractConnection conn) {} |