Qore DiscordDataProvider Module Reference 2.0
Loading...
Searching...
No Matches
DiscordGatewayDataProvider.qc.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
26namespace DiscordDataProvider {
28const EVENT_MESSAGE_CREATE = "MESSAGE_CREATE";
29
31class DiscordGatewayDataProvider : public DataProvider::AbstractDataProvider, public DataProvider::DelayedObservable, public DataProvider::Observer {
32
33public:
35 const ProviderInfo = ...;
36
37
39 const ConstructorOptions = ...;
40
41
42protected:
44 *DiscordWebSocketClient::DiscordWebSocketConnection conn;
45
47 *DiscordWebSocketClient::DiscordWebSocketClient ws;
48
49public:
50
52 constructor(*hash<auto> options);
53
54
56 constructor(DiscordWebSocketClient::DiscordWebSocketClient ws);
57
58
60 constructor(DiscordWebSocketClient::DiscordWebSocketConnection conn);
61
62
65
66
68 bool reconnect();
69
70
72
76 update(string event_id, hash<auto> msg);
77
78
80 hash<auto> getWebSocketInfo();
81
82
84
87
88
90
93
94
96 string getName();
97
98
100 *string getDesc();
101
102
104 setLogger(*LoggerInterface logger);
105
106
108 static DiscordWebSocketClient::DiscordWebSocketClient getWebSocketConnection(*hash<auto> options, *Logger::LoggerInterface logger);
109
111
116protected:
117 *hash<DataProviderConnectionInfo> getConnectionInfoImpl();
118public:
119
120
122
126protected:
127 hash<string, hash<DataProviderMessageInfo>> getEventTypesImpl();
128public:
129
130
132protected:
133 hash<DataProvider::DataProviderInfo> getStaticInfoImpl();
134public:
135
136};
137};
The Discord gateway data provider class.
Definition DiscordGatewayDataProvider.qc.dox.h:31
setLogger(*LoggerInterface logger)
Accepts a LoggerInterface object for logging (or clears it)
*hash< DataProviderConnectionInfo > getConnectionInfoImpl()
Returns connection info.
static DiscordWebSocketClient::DiscordWebSocketClient getWebSocketConnection(*hash< auto > options, *Logger::LoggerInterface logger)
Returns a DiscordWebSocketClient connection from the options.
string getName()
Returns the data provider name.
*DiscordWebSocketClient::DiscordWebSocketConnection conn
The connection object used to create the REST client.
Definition DiscordGatewayDataProvider.qc.dox.h:44
stopEvents()
Called to stop generating events.
hash< DataProvider::DataProviderInfo > getStaticInfoImpl()
Returns data provider static info.
const ConstructorOptions
Constructor options.
Definition DiscordGatewayDataProvider.qc.dox.h:39
observersReady()
Called when all observers have been added to the object.
constructor(DiscordWebSocketClient::DiscordWebSocketClient ws)
Creates the object from a DiscordWebSocketClient.
hash< auto > getWebSocketInfo()
Returns information about the connection.
constructor(DiscordWebSocketClient::DiscordWebSocketConnection conn)
Creates the object from a DiscordWebSocketConnection.
*DiscordWebSocketClient::DiscordWebSocketClient ws
The WebSocket client object.
Definition DiscordGatewayDataProvider.qc.dox.h:47
constructor(*hash< auto > options)
Creates the object from constructor options.
const ProviderInfo
Provider info.
Definition DiscordGatewayDataProvider.qc.dox.h:35
*string getDesc()
Returns the data provider description.
bool reconnect()
Reconnects with the gateway immediately.
hash< string, hash< DataProviderMessageInfo > > getEventTypesImpl()
Returns a hash of all supported event types.
update(string event_id, hash< auto > msg)
This method is called when an event is raised.
Qore DiscordDataProvider module definition.
Definition DiscordDataProvider.qc.dox.h:26
const EVENT_MESSAGE_CREATE
Discord MESSAGE_CREATE event constant.
Definition DiscordGatewayDataProvider.qc.dox.h:28