mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-20 21:57:14 +08:00
init: build minimum viable version
This commit is contained in:
31
channel/channel.py
Normal file
31
channel/channel.py
Normal file
@@ -0,0 +1,31 @@
|
||||
"""
|
||||
Message sending channel abstract class
|
||||
"""
|
||||
|
||||
from bridge.bridge import Bridge
|
||||
|
||||
class Channel(object):
|
||||
def startup(self):
|
||||
"""
|
||||
init channel
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
def handle(self, msg):
|
||||
"""
|
||||
process received msg
|
||||
:param msg: message object
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
def send(self, msg, receiver):
|
||||
"""
|
||||
send message to user
|
||||
:param msg: message content
|
||||
:param receiver: receiver channel account
|
||||
:return:
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
def build_reply_content(self, query):
|
||||
return Bridge().fetch_reply_content(query)
|
||||
Reference in New Issue
Block a user