Files
chatgpt-on-wechat/channel/channel_factory.py
2023-02-20 12:03:28 +08:00

20 lines
441 B
Python

"""
channel factory
"""
from channel.wechat.wechat_channel import WechatChannel
from channel.wechat.wechaty_channel import WechatyChannel
def create_channel(channel_type):
"""
create a channel instance
:param channel_type: channel type code
:return: channel instance
"""
if channel_type == 'wx':
return WechatChannel()
elif channel_type == 'wxy':
return WechatyChannel()
raise RuntimeError