Qore DiscordDataProvider Module Reference 2.0
Loading...
Searching...
No Matches
DiscordGatewayDataProvider.qc.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
24
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
69
70
72 bool reconnect();
73
74
76
80 update(string event_id, hash<auto> msg);
81
82
84 hash<auto> getWebSocketInfo();
85
86
88
91
92
94
97
98
100 string getName();
101
102
104 *string getDesc();
105
106
108 setLogger(*LoggerInterface logger);
109
110
112 static DiscordWebSocketClient::DiscordWebSocketClient getWebSocketConnection(*hash<auto> options, *Logger::LoggerInterface logger);
113
115
120protected:
121 *hash<DataProviderConnectionInfo> getConnectionInfoImpl();
122public:
123
124
126
130protected:
131 hash<string, hash<DataProviderMessageInfo>> getEventTypesImpl();
132public:
133
134
136protected:
137 hash<DataProvider::DataProviderInfo> getStaticInfoImpl();
138public:
139
140};
141};
The Discord gateway data provider class.
Definition DiscordGatewayDataProvider.qc.dox.h:31
setLogger(*LoggerInterface logger)
Accepts a LoggerInterface object for logging (or clears it)
disconnect()
Disconnects from the gateway and stops all background threads.
*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