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

#include <chatroommessagehandler.h>

Classes

class  ICallbacks
 

Public Types

enum  CommandError {
  CommandError::Ban, CommandError::Unban, CommandError::Timeout, CommandError::Untimeout,
  CommandError::Mod, CommandError::Unmod, CommandError::Color, CommandError::Topic,
  CommandError::Slow, CommandError::Me
}
 

Public Member Functions

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

Private Attributes

std::shared_ptr< ICallbacksmCallbacks
 

Detailed Description

Class that receives messages to parse out special commands such as /ban before being sent to IChatRoom::SendMessage. Custom callback functions must inherit ICallbacks and passed in through the constructor first. Messages being sent will be passed in through HandleMessage().

Member Enumeration Documentation

◆ CommandError

CommandError - Represents which command had an error while sending.

Enumerator
Ban 
Unban 
Timeout 
Untimeout 
Mod 
Unmod 
Color 
Topic 
Slow 
Me 

Constructor & Destructor Documentation

◆ ChatRoomMessageHandler()

ttv::chat::ChatRoomMessageHandler::ChatRoomMessageHandler ( )

Member Function Documentation

◆ HandleMessage()

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

Takes in outgoing chat room 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 the chat room.
Returns
The result of the callback function.

◆ SetCallbacks()

void ttv::chat::ChatRoomMessageHandler::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::ChatRoomMessageHandler::mCallbacks
private

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