Files
pytchat-fork/pytchat/processors/chat_processor.py
2020-07-12 23:23:05 +09:00

31 lines
801 B
Python

class ChatProcessor:
'''
Abstract class that processes chat data.
Receive chat data (actions) from Listener.
'''
def process(self, chat_components: list):
'''
Interface that represents processing of chat data.
Called from LiveChat object.
Parameter
----------
chat_components: List[component]
component : dict {
"video_id" : str
"timeout" : int
Time to fetch next chat (seconds)
"chatdata" : List[dict]
List of chat data.
}
'''
pass
def finalize(self, *args, **kwargs):
'''
Interface for finalizing the process.
Called when chat fetching finished.
'''
pass