Twitch SDK (Internal)
chatmessagehandler.h
Go to the documentation of this file.
1 /********************************************************************************************
2  * Twitch Broadcasting SDK
3  *
4  * This software is supplied under the terms of a license agreement with Twitch Interactive, Inc. and
5  * may not be copied or used except in accordance with the terms of that agreement
6  * Copyright (c) 2017 Twitch Interactive, Inc.
7  *********************************************************************************************/
8 
9 #pragma once
10 
12 
13 namespace ttv
14 {
15  namespace chat
16  {
17  class ChatMessageHandler;
18  }
19 }
20 
27 {
28 public:
33  class ICallbacks
34  {
35  public:
36  virtual ~ICallbacks() = default;
37 
45  virtual bool PassThrough(const std::string& message) = 0;
46 
54  virtual bool BlockUser(const std::string& blockUserName) = 0;
55 
63  virtual bool UnblockUser(const std::string& unblockUserName) = 0;
64 
72  virtual bool WhisperUser(const std::string& whisperUserName, const std::string& message) = 0;
73 
80  virtual bool CreateRaid(const std::string& raidTargetUserName) = 0;
81 
86  virtual bool CancelRaid() = 0;
87  };
88 
90 
98  bool HandleMessage(const std::string& message);
99 
105  void SetCallbacks(const std::shared_ptr<ICallbacks>& callbacks) { mCallbacks = callbacks; }
106 
107 private:
108  std::shared_ptr<ICallbacks> mCallbacks;
109 };
virtual bool CreateRaid(const std::string &raidTargetUserName)=0
void SetCallbacks(const std::shared_ptr< ICallbacks > &callbacks)
Definition: chatmessagehandler.h:105
Definition: chatmessagehandler.h:26
virtual bool PassThrough(const std::string &message)=0
virtual bool UnblockUser(const std::string &unblockUserName)=0
JSON (JavaScript Object Notation).
Definition: adsapi.h:16
bool HandleMessage(const std::string &message)
virtual bool WhisperUser(const std::string &whisperUserName, const std::string &message)=0
virtual bool BlockUser(const std::string &blockUserName)=0
std::shared_ptr< ICallbacks > mCallbacks
Definition: chatmessagehandler.h:108
Definition: chatmessagehandler.h:33