您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

1234567891011121314151617181920212223242526272829303132
  1. # encoding:utf-8
  2. import os
  3. from config import conf, load_config
  4. from channel import channel_factory
  5. from common.log import logger
  6. from plugins import *
  7. def run():
  8. try:
  9. # load config
  10. load_config()
  11. # create channel
  12. channel_name=conf().get('channel_type', 'wx')
  13. if channel_name == 'wxy':
  14. os.environ['WECHATY_LOG']="warn"
  15. # os.environ['WECHATY_PUPPET_SERVICE_ENDPOINT'] = '127.0.0.1:9001'
  16. channel = channel_factory.create_channel(channel_name)
  17. if channel_name in ['wx','wxy']:
  18. PluginManager().load_plugins()
  19. # startup channel
  20. channel.startup()
  21. except Exception as e:
  22. logger.error("App startup failed!")
  23. logger.exception(e)
  24. if __name__ == '__main__':
  25. run()