Twitch SDK (Internal)
Classes | Public Member Functions | Private Attributes | List of all members
ttv::chat::ChatMessageHandler Class Reference

#include <chatmessagehandler.h>

Classes

class  ICallbacks
 

Public Member Functions

 ChatMessageHandler ()
 
bool HandleMessage (const std::string &message)
 
void SetCallbacks (const std::shared_ptr< ICallbacks > &callbacks)
 

Private Attributes

std::shared_ptr< ICallbacksmCallbacks
 

Detailed Description

Handles messages that are being sent in chat for special commands such as /ignore. Custom callback functions must inherit ICallbacks and passed in through the constructor first. Messages being sent will be passed in through HandleMessage().

Constructor & Destructor Documentation

◆ ChatMessageHandler()

ttv::chat::ChatMessageHandler::ChatMessageHandler ( )

Member Function Documentation

◆ HandleMessage()

bool ttv::chat::ChatMessageHandler::HandleMessage ( const std::string &  message)

Takes in outgoing chat messages and call the corresponding callback function based on the contents of the message.

Precondition
Callback functions must be set previously through SetCallbacks.
Parameters
[in]messageThe message being sent to chat.
Returns
The result of the callback function.

◆ SetCallbacks()

void ttv::chat::ChatMessageHandler::SetCallbacks ( const std::shared_ptr< ICallbacks > &  callbacks)
inline

Sets the callbacks functions that are called when HandleMessage is called.

Parameters
[in]callbacksPointer to the inherited ICallbacks class.

Member Data Documentation

◆ mCallbacks

std::shared_ptr<ICallbacks> ttv::chat::ChatMessageHandler::mCallbacks
private

The documentation for this class was generated from the following file: