Browse Source

增加群组语言功能

develop
zwssunny 1 year ago
parent
commit
5b85e60d5d
3 changed files with 7 additions and 6 deletions
  1. +3
    -3
      app.py
  2. +3
    -3
      bot/bot_factory.py
  3. +1
    -0
      config.py

+ 3
- 3
app.py View File

@@ -1,6 +1,6 @@
# encoding:utf-8 # encoding:utf-8


import config
from config import conf, load_config
from channel import channel_factory from channel import channel_factory
from common.log import logger from common.log import logger


@@ -9,10 +9,10 @@ from plugins import *
def run(): def run():
try: try:
# load config # load config
config.load_config()
load_config()


# create channel # create channel
channel_name='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=='wx':
PluginManager().load_plugins() PluginManager().load_plugins()


+ 3
- 3
bot/bot_factory.py View File

@@ -6,9 +6,9 @@ from common import const


def create_bot(bot_type): def create_bot(bot_type):
""" """
create a channel instance
:param channel_type: channel type code
:return: channel instance
create a bot_type instance
:param bot_type: bot type code
:return: bot instance
""" """
if bot_type == const.BAIDU: if bot_type == const.BAIDU:
# Baidu Unit对话接口 # Baidu Unit对话接口


+ 1
- 0
config.py View File

@@ -70,6 +70,7 @@ available_setting = {


# chatgpt指令自定义触发词 # chatgpt指令自定义触发词
"clear_memory_commands": ['#清除记忆'], # 重置会话指令 "clear_memory_commands": ['#清除记忆'], # 重置会话指令
"channel_type": "wx", # 通道类型,支持wx,wxy和terminal




} }


Loading…
Cancel
Save