Qore DiscordDataProvider Module Reference 2.0
Loading...
Searching...
No Matches
DiscordDataProviderBase.qc.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
26namespace DiscordDataProvider {
28class DiscordDataProviderBase : public DataProvider::AbstractDataProvider {
29
30public:
32 const RetrySet = ...;
33
34
36 const MaxIoRetries = 5;
37
38protected:
40 *DiscordRestConnection conn;
41
43 *DiscordRestClient rest;
44
45public:
46
49
50
52 constructor(DiscordRestClient rest, *Logger::LoggerInterface logger);
53
54
56 constructor(DiscordRestConnection conn, *Logger::LoggerInterface logger);
57
58
60 setLogger(*LoggerInterface logger);
61
62
64 static threadWait(date wait_period);
65
67protected:
68 hash<auto> getGuild(string id);
69public:
70
71
73protected:
74 hash<auto> doRestCommand(string method, string path, auto body, reference<hash<auto>> info);
75public:
76
77
79protected:
80 bool retry(hash<ExceptionInfo> ex, reference<int> retries);
81public:
82
83};
84};
The Discord data provider base class.
Definition DiscordDataProviderBase.qc.dox.h:28
bool retry(hash< ExceptionInfo > ex, reference< int > retries)
Returns True if the error indicates that the operation should be retried.
constructor(DiscordRestConnection conn, *Logger::LoggerInterface logger)
Creates the object.
constructor(DiscordRestClient rest, *Logger::LoggerInterface logger)
Creates the object.
*DiscordRestClient rest
The REST client object for API calls.
Definition DiscordDataProviderBase.qc.dox.h:43
*DiscordRestConnection conn
The connection object used to create the REST client.
Definition DiscordDataProviderBase.qc.dox.h:40
setLogger(*LoggerInterface logger)
Accepts a LoggerInterface object for logging (or clears it)
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.
static threadWait(date wait_period)
Wait for a given period of time.
const MaxIoRetries
Max retries.
Definition DiscordDataProviderBase.qc.dox.h:36
const RetrySet
IO errors for REST retries.
Definition DiscordDataProviderBase.qc.dox.h:32
hash< auto > getGuild(string id)
Retrieves info for the given guild; must be accessible to the calling user.
Qore DiscordDataProvider module definition.
Definition DiscordDataProvider.qc.dox.h:26