mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-19 21:07:28 +08:00
plugins: support wechaty channel
This commit is contained in:
2
app.py
2
app.py
@@ -14,7 +14,7 @@ def run():
|
|||||||
# create channel
|
# create channel
|
||||||
channel_name=conf().get('channel_type', 'wx')
|
channel_name=conf().get('channel_type', 'wx')
|
||||||
channel = channel_factory.create_channel(channel_name)
|
channel = channel_factory.create_channel(channel_name)
|
||||||
if channel_name=='wx':
|
if channel_name in ['wx','wxy']:
|
||||||
PluginManager().load_plugins()
|
PluginManager().load_plugins()
|
||||||
|
|
||||||
# startup channel
|
# startup channel
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ class WechatyChannel(ChatChannel):
|
|||||||
config = conf()
|
config = conf()
|
||||||
token = config.get('wechaty_puppet_service_token')
|
token = config.get('wechaty_puppet_service_token')
|
||||||
os.environ['WECHATY_PUPPET_SERVICE_TOKEN'] = token
|
os.environ['WECHATY_PUPPET_SERVICE_TOKEN'] = token
|
||||||
|
os.environ['WECHATY_LOG']="warn"
|
||||||
|
# os.environ['WECHATY_PUPPET_SERVICE_ENDPOINT'] = '127.0.0.1:9001'
|
||||||
self.bot = Wechaty()
|
self.bot = Wechaty()
|
||||||
self.bot.on('login', self.on_login)
|
self.bot.on('login', self.on_login)
|
||||||
self.bot.on('message', self.on_message)
|
self.bot.on('message', self.on_message)
|
||||||
|
|||||||
Reference in New Issue
Block a user