Loading...
Searching...
No Matches
DiscordDataProvider::DiscordGatewayDataProvider Class Reference

The Discord gateway data provider class. More...

`#include <DiscordGatewayDataProvider.qc.dox.h>`

## Public Member Functions

| constructor (*hash< auto > options)
| Creates the object from constructor options.
| constructor (DiscordWebSocketClient::DiscordWebSocketClient ws)
| Creates the object from a DiscordWebSocketClient.
| constructor (DiscordWebSocketClient::DiscordWebSocketConnection conn)
| Creates the object from a DiscordWebSocketConnection.
| destructor ()
| Deletes the object.
*string | getDesc ()
| Returns the data provider description.
string | getName ()
| Returns the data provider name.
hash< auto > | getWebSocketInfo ()
| Returns information about the connection.
| observersReady ()
| Called when all observers have been added to the object.
bool | reconnect ()
| Reconnects with the gateway immediately.
| setLogger (*LoggerInterface logger)
| Accepts a LoggerInterface object for logging (or clears it)
| stopEvents ()
| Called to stop generating events.
| update (string event_id, hash< auto > msg)
| This method is called when an event is raised.

## Static Public Member Functions

static DiscordWebSocketClient::DiscordWebSocketClient | getWebSocketConnection (*hash< auto > options, *Logger::LoggerInterface logger)
| Returns a DiscordWebSocketClient connection from the options.

## Public Attributes

const | ConstructorOptions = ...
| Constructor options.
const | ProviderInfo = ...
| Provider info.

## Protected Member Functions

*hash< DataProviderConnectionInfo > | getConnectionInfoImpl ()
| Returns connection info.
hash< string, hash< DataProviderMessageInfo > > | getEventTypesImpl ()
| Returns a hash of all supported event types.
hash< DataProvider::DataProviderInfo > | getStaticInfoImpl ()
| Returns data provider static info.

## Protected Attributes

*DiscordWebSocketClient::DiscordWebSocketConnection | conn
| The connection object used to create the REST client.
*DiscordWebSocketClient::DiscordWebSocketClient | ws
| The WebSocket client object.

## Detailed Description

The Discord gateway data provider class.

## Member Function Documentation

## getConnectionInfoImpl()

*hash< DataProviderConnectionInfo > DiscordDataProvider::DiscordGatewayDataProvider::getConnectionInfoImpl | ( |  | ) |

protected

Returns connection info.

Returns
  the connection hash; see WebSocketClient::getConnectionInfo() for information about the `info` key

Since
  DataProvider 3.0

## getEventTypesImpl()

hash< string, hash< DataProviderMessageInfo > > DiscordDataProvider::DiscordGatewayDataProvider::getEventTypesImpl | ( |  | ) |

protected

Returns a hash of all supported event types.

Returns
  a hash of all supported event types

Note
  only called if the provider supports the observer pattern / event API

## observersReady()

DiscordDataProvider::DiscordGatewayDataProvider::observersReady | ( |  | ) |

Called when all observers have been added to the object.

This method is meant to trigger event generation

## stopEvents()

DiscordDataProvider::DiscordGatewayDataProvider::stopEvents | ( |  | ) |

Called to stop generating events.

Disconnects from the server

## update()

DiscordDataProvider::DiscordGatewayDataProvider::update | ( | string | event_id,
|  | hash< auto > | msg )

This method is called when an event is raised.

Parameters

  event_id | unique ID identifying an event type or class
  msg | the data generated by the Observable event source