| Qore DiscordDataProvider Module Reference 2.0

Loading...
Searching...
No Matches
DiscordGatewayDataProvider.qc.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
24
26 namespace DiscordDataProvider {
28 const EVENT_MESSAGE_CREATE = "MESSAGE_CREATE";
29
31 class DiscordGatewayDataProvider : public DataProvider::AbstractDataProvider, public DataProvider::DelayedObservable, public DataProvider::Observer {
32
33 public:
35 const ProviderInfo = ...;
36
37
39 const ConstructorOptions = ...;
40
41
42 protected:
44 *DiscordWebSocketClient::DiscordWebSocketConnection conn;
45
47 *DiscordWebSocketClient::DiscordWebSocketClient ws;
48
49 public:
50
52 constructor(*hash<auto> options);
53
54
56 constructor(DiscordWebSocketClient::DiscordWebSocketClient ws);
57
58
60 constructor(DiscordWebSocketClient::DiscordWebSocketConnection conn);
61
62
64 destructor();
65
66
68 disconnect();
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
90 observersReady();
91
92
94
96 stopEvents();
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
120 protected:
121 *hash<DataProviderConnectionInfo> getConnectionInfoImpl();
122 public:
123
124
126
130 protected:
131 hash<string, hash<DataProviderMessageInfo>> getEventTypesImpl();
132 public:
133
134
136 protected:
137 hash<DataProvider::DataProviderInfo> getStaticInfoImpl();
138 public:
139
140};
141};
DiscordDataProvider::DiscordGatewayDataProvider
The Discord gateway data provider class.
Definition DiscordGatewayDataProvider.qc.dox.h:31
DiscordDataProvider::DiscordGatewayDataProvider::setLogger
setLogger(*LoggerInterface logger)
Accepts a LoggerInterface object for logging (or clears it)
DiscordDataProvider::DiscordGatewayDataProvider::disconnect
disconnect()
Disconnects from the gateway and stops all background threads.
DiscordDataProvider::DiscordGatewayDataProvider::getConnectionInfoImpl
*hash< DataProviderConnectionInfo > getConnectionInfoImpl()
Returns connection info.
DiscordDataProvider::DiscordGatewayDataProvider::getWebSocketConnection
static DiscordWebSocketClient::DiscordWebSocketClient getWebSocketConnection(*hash< auto > options, *Logger::LoggerInterface logger)
Returns a DiscordWebSocketClient connection from the options.
DiscordDataProvider::DiscordGatewayDataProvider::getName
string getName()
Returns the data provider name.
DiscordDataProvider::DiscordGatewayDataProvider::conn
*DiscordWebSocketClient::DiscordWebSocketConnection conn
The connection object used to create the REST client.
Definition DiscordGatewayDataProvider.qc.dox.h:44
DiscordDataProvider::DiscordGatewayDataProvider::stopEvents
stopEvents()
Called to stop generating events.
DiscordDataProvider::DiscordGatewayDataProvider::getStaticInfoImpl
hash< DataProvider::DataProviderInfo > getStaticInfoImpl()
Returns data provider static info.
DiscordDataProvider::DiscordGatewayDataProvider::ConstructorOptions
const ConstructorOptions
Constructor options.
Definition DiscordGatewayDataProvider.qc.dox.h:39
DiscordDataProvider::DiscordGatewayDataProvider::observersReady
observersReady()
Called when all observers have been added to the object.
DiscordDataProvider::DiscordGatewayDataProvider::constructor
constructor(DiscordWebSocketClient::DiscordWebSocketClient ws)
Creates the object from a DiscordWebSocketClient.
DiscordDataProvider::DiscordGatewayDataProvider::getWebSocketInfo
hash< auto > getWebSocketInfo()
Returns information about the connection.
DiscordDataProvider::DiscordGatewayDataProvider::constructor
constructor(DiscordWebSocketClient::DiscordWebSocketConnection conn)
Creates the object from a DiscordWebSocketConnection.
DiscordDataProvider::DiscordGatewayDataProvider::ws
*DiscordWebSocketClient::DiscordWebSocketClient ws
The WebSocket client object.
Definition DiscordGatewayDataProvider.qc.dox.h:47
DiscordDataProvider::DiscordGatewayDataProvider::constructor
constructor(*hash< auto > options)
Creates the object from constructor options.
DiscordDataProvider::DiscordGatewayDataProvider::ProviderInfo
const ProviderInfo
Provider info.
Definition DiscordGatewayDataProvider.qc.dox.h:35
DiscordDataProvider::DiscordGatewayDataProvider::destructor
destructor()
Deletes the object.
DiscordDataProvider::DiscordGatewayDataProvider::getDesc
*string getDesc()
Returns the data provider description.
DiscordDataProvider::DiscordGatewayDataProvider::reconnect
bool reconnect()
Reconnects with the gateway immediately.
DiscordDataProvider::DiscordGatewayDataProvider::getEventTypesImpl
hash< string, hash< DataProviderMessageInfo > > getEventTypesImpl()
Returns a hash of all supported event types.
DiscordDataProvider::DiscordGatewayDataProvider::update
update(string event_id, hash< auto > msg)
This method is called when an event is raised.
DiscordDataProvider
Qore DiscordDataProvider module definition.
Definition DiscordDataProvider.qc.dox.h:26
DiscordDataProvider::EVENT_MESSAGE_CREATE
const EVENT_MESSAGE_CREATE
Discord MESSAGE_CREATE event constant.
Definition DiscordGatewayDataProvider.qc.dox.h:28