mirror of
https://github.com/zhayujie/bot-on-anything.git
synced 2026-03-04 07:47:58 +08:00
feat: support terminal channel
This commit is contained in:
14
app.py
14
app.py
@@ -2,20 +2,24 @@
|
||||
|
||||
import config
|
||||
from channel import channel_factory
|
||||
from common.log import logger
|
||||
from common import log
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
# load config
|
||||
config.load_config()
|
||||
logger.info("[INIT] load config: {}".format(config.conf()))
|
||||
|
||||
model_type = config.conf().get("model").get("type")
|
||||
channel_type = config.conf().get("channel").get("type")
|
||||
|
||||
log.info("[INIT] Start up: {} on {}", model_type, channel_type)
|
||||
|
||||
# create channel
|
||||
channel = channel_factory.create_channel(config.conf().get("channel").get("type"))
|
||||
channel = channel_factory.create_channel(channel_type)
|
||||
|
||||
# startup channel
|
||||
channel.startup()
|
||||
except Exception as e:
|
||||
logger.error("App startup failed!")
|
||||
logger.exception(e)
|
||||
log.error("App startup failed!")
|
||||
log.exception(e)
|
||||
|
||||
Reference in New Issue
Block a user