Twitch SDK (Internal)
Public Member Functions | List of all members
ttv::chat::ChatRoomMessageHandler::ICallbacks Class Referenceabstract

#include <chatroommessagehandler.h>

Inheritance diagram for ttv::chat::ChatRoomMessageHandler::ICallbacks:
ttv::binding::java::NativeListenerProxy< ChatRoomMessageHandler::ICallbacks > ttv::binding::java::JavaChatRoomMessageHandlerCallbacksProxy

Public Member Functions

virtual ~ICallbacks ()=default
 
virtual bool PassThrough (const std::string &message)=0
 
virtual bool BanUser (const std::string &userName)=0
 
virtual bool UnbanUser (const std::string &userName)=0
 
virtual bool TimeoutUser (const std::string &userName, uint32_t duration)=0
 
virtual bool UntimeoutUser (const std::string &userName)=0
 
virtual bool SetUserColor (const std::string &color)=0
 
virtual bool Help ()=0
 
virtual bool ListRooms ()=0
 
virtual bool ModUser (const std::string &userName)=0
 
virtual bool UnmodUser (const std::string &userName)=0
 
virtual bool ListModerators ()=0
 
virtual bool SetTopic (const std::string &topic)=0
 
virtual bool SlowMode (bool turnOn, uint32_t durationSeconds)=0
 
virtual bool R9kMode (bool turnOn)=0
 
virtual bool EmotesOnlyMode (bool turnOn)=0
 
virtual bool MalformedCommand (CommandError command)=0
 

Detailed Description

Create your own callbacks class that inherits from this, then pass in that class to the ChatMessageHandler constructor.

Constructor & Destructor Documentation

◆ ~ICallbacks()

virtual ttv::chat::ChatRoomMessageHandler::ICallbacks::~ICallbacks ( )
virtualdefault

Member Function Documentation

◆ BanUser()

virtual bool ttv::chat::ChatRoomMessageHandler::ICallbacks::BanUser ( const std::string &  userName)
pure virtual

Called for valid /ban commands. Typically should call ChatAPI::BanUser().

Parameters
[in]userNameThe name of the user to be banned.
Returns
True if the message was handled properly, else false.

Implemented in ttv::binding::java::JavaChatRoomMessageHandlerCallbacksProxy.

◆ EmotesOnlyMode()

virtual bool ttv::chat::ChatRoomMessageHandler::ICallbacks::EmotesOnlyMode ( bool  turnOn)
pure virtual

Called for valid '/emoteonly' and '/emoteonlyoff' commands. Typically should call ChatRoom::SetMode().

Parameters
[in]turnOnIf true, we want to enable emotes-only mode in the room. If false, we want to disable emote-only mode.
Returns
True if the message was handled properly, else false.

Implemented in ttv::binding::java::JavaChatRoomMessageHandlerCallbacksProxy.

◆ Help()

virtual bool ttv::chat::ChatRoomMessageHandler::ICallbacks::Help ( )
pure virtual

Called for valid /help commands. Typically should display information about the chat room commands.

Returns
True if the message was handled properly, else false.

Implemented in ttv::binding::java::JavaChatRoomMessageHandlerCallbacksProxy.

◆ ListModerators()

virtual bool ttv::chat::ChatRoomMessageHandler::ICallbacks::ListModerators ( )
pure virtual

Called for valid /mods commands. Typically should call ChatAPI::FetchChannelModerators().

Returns
True if the message was handled properly, else false.

Implemented in ttv::binding::java::JavaChatRoomMessageHandlerCallbacksProxy.

◆ ListRooms()

virtual bool ttv::chat::ChatRoomMessageHandler::ICallbacks::ListRooms ( )
pure virtual

Called for valid /listrooms commands. Typically should call ChannelChatRoomManager::FetchChannelChatRoomsInfo().

Returns
True if the message was handled properly, else false.

Implemented in ttv::binding::java::JavaChatRoomMessageHandlerCallbacksProxy.

◆ MalformedCommand()

virtual bool ttv::chat::ChatRoomMessageHandler::ICallbacks::MalformedCommand ( CommandError  command)
pure virtual

Called for invalid commands.

Parameters
[in]commandAn enum representing which command failed.
Returns
True if the error message was handled properly, else false.

Implemented in ttv::binding::java::JavaChatRoomMessageHandlerCallbacksProxy.

◆ ModUser()

virtual bool ttv::chat::ChatRoomMessageHandler::ICallbacks::ModUser ( const std::string &  userName)
pure virtual

Called for valid /mod commands. Typically should call ChatAPI::ModUser() after checking the sender of the message owns the current channel.

Parameters
[in]userNameThe name of the user being modded.
Returns
True if the message was handled properly, else false.

Implemented in ttv::binding::java::JavaChatRoomMessageHandlerCallbacksProxy.

◆ PassThrough()

virtual bool ttv::chat::ChatRoomMessageHandler::ICallbacks::PassThrough ( const std::string &  message)
pure virtual

The message contains normal text or an unhandled command. Callback typically should call ChatRoom::SendMessage().

Parameters
[in]messageThe message string being delivered through chat.
Returns
True if message was handled properly, else false.

Implemented in ttv::binding::java::JavaChatRoomMessageHandlerCallbacksProxy.

◆ R9kMode()

virtual bool ttv::chat::ChatRoomMessageHandler::ICallbacks::R9kMode ( bool  turnOn)
pure virtual

Called for valid '/r9kbeta' and '/r9kbetaoff' commands. Typically should call ChatRoom::SetMode().

Parameters
[in]turnOnIf true, we want to enable r9k mode in the room. If false, we want to disable r9k mode.
Returns
True if the message was handled properly, else false.

Implemented in ttv::binding::java::JavaChatRoomMessageHandlerCallbacksProxy.

◆ SetTopic()

virtual bool ttv::chat::ChatRoomMessageHandler::ICallbacks::SetTopic ( const std::string &  topic)
pure virtual

Called for valid /topic commands. Typically should call ChatRoom::SetTopic().

Parameters
[in]topicThe new topic of the room.
Returns
True if the message was handled properly, else false.

Implemented in ttv::binding::java::JavaChatRoomMessageHandlerCallbacksProxy.

◆ SetUserColor()

virtual bool ttv::chat::ChatRoomMessageHandler::ICallbacks::SetUserColor ( const std::string &  color)
pure virtual

Called for valid /color commands. Typically should call ChatAPI::UpdateUserColor().

Parameters
[in]colorThe color being changed to.
Returns
True if the message was handled properly, else false.

Implemented in ttv::binding::java::JavaChatRoomMessageHandlerCallbacksProxy.

◆ SlowMode()

virtual bool ttv::chat::ChatRoomMessageHandler::ICallbacks::SlowMode ( bool  turnOn,
uint32_t  durationSeconds 
)
pure virtual

Called for valid '/slow' and '/slowoff' commands. Typically should call ChatRoom::SetMode().

Parameters
[in]turnOnIf true, we want to enable slow mode in the room. If false, we want to disable slow mode.
[in]durationSecondsThe number of seconds a viewer has to wait between sending messages. Value is ignored if we're turning slow mode off.
Returns
True if the message was handled properly, else false.

Implemented in ttv::binding::java::JavaChatRoomMessageHandlerCallbacksProxy.

◆ TimeoutUser()

virtual bool ttv::chat::ChatRoomMessageHandler::ICallbacks::TimeoutUser ( const std::string &  userName,
uint32_t  duration 
)
pure virtual

Called for valid '/timeout' commands. Typically should call ChatAPI::BanUser().

Parameters
[in]userNameThe name of the user to be timed out.
[in]durationHow long the user is timed out for in seconds.
Returns
True if the message was handled properly, else false.

Implemented in ttv::binding::java::JavaChatRoomMessageHandlerCallbacksProxy.

◆ UnbanUser()

virtual bool ttv::chat::ChatRoomMessageHandler::ICallbacks::UnbanUser ( const std::string &  userName)
pure virtual

Called for valid /unban commands. Typically should call ChatAPI::UnbanUser().

Parameters
[in]userNameThe name of the user being unbanned.
Returns
True if the message was handled properly, else false.

Implemented in ttv::binding::java::JavaChatRoomMessageHandlerCallbacksProxy.

◆ UnmodUser()

virtual bool ttv::chat::ChatRoomMessageHandler::ICallbacks::UnmodUser ( const std::string &  userName)
pure virtual

Called for valid /unmod commands. Typically should call ChatAPI::UnmodUser() after checking the sender of the message owns the current channel.

Parameters
[in]userNameThe name of the user being unmodded.
Returns
True if the message was handled properly, else false.

Implemented in ttv::binding::java::JavaChatRoomMessageHandlerCallbacksProxy.

◆ UntimeoutUser()

virtual bool ttv::chat::ChatRoomMessageHandler::ICallbacks::UntimeoutUser ( const std::string &  userName)
pure virtual

Called for valid '/untimeout' commands. Typically should call ChatAPI::UnbanUser().

Parameters
[in]userNameThe name of the user being untimedout.
Returns
True if the message was handled properly, else false.

Implemented in ttv::binding::java::JavaChatRoomMessageHandlerCallbacksProxy.


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