Browse Source

plugins : provide help url when plugin init failed

master
lanvent 1 year ago
parent
commit
167f10c9f9
3 changed files with 5 additions and 5 deletions
  1. +1
    -1
      plugins/banwords/banwords.py
  2. +2
    -2
      plugins/role/role.py
  3. +2
    -2
      plugins/sdwebui/sdwebui.py

+ 1
- 1
plugins/banwords/banwords.py View File

@@ -38,7 +38,7 @@ class Banwords(Plugin):
self.handlers[Event.ON_HANDLE_CONTEXT] = self.on_handle_context self.handlers[Event.ON_HANDLE_CONTEXT] = self.on_handle_context
logger.info("[Banwords] inited") logger.info("[Banwords] inited")
except Exception as e: except Exception as e:
logger.warn("Banwords init failed: %s" % e)
logger.warn("Banwords init failed: %s, ignore or see https://github.com/zhayujie/chatgpt-on-wechat/tree/master/plugins/banwords ." % e)






+ 2
- 2
plugins/role/role.py View File

@@ -45,9 +45,9 @@ class Role(Plugin):
self.roleplays = {} self.roleplays = {}
logger.info("[Role] inited") logger.info("[Role] inited")
except FileNotFoundError: except FileNotFoundError:
logger.error(f"[Role] init failed, {config_path} not found")
logger.warn(f"[Role] init failed, {config_path} not found, ignore or see https://github.com/zhayujie/chatgpt-on-wechat/tree/master/plugins/role .")
except Exception as e: except Exception as e:
logger.error("[Role] init failed, exception: %s" % e)
logger.warn("[Role] init failed, exception: %s, ignore or see https://github.com/zhayujie/chatgpt-on-wechat/tree/master/plugins/role ." % e)


def get_role(self, name, find_closest=True): def get_role(self, name, find_closest=True):
name = name.lower() name = name.lower()


+ 2
- 2
plugins/sdwebui/sdwebui.py View File

@@ -30,9 +30,9 @@ class SDWebUI(Plugin):
self.handlers[Event.ON_HANDLE_CONTEXT] = self.on_handle_context self.handlers[Event.ON_HANDLE_CONTEXT] = self.on_handle_context
logger.info("[SD] inited") logger.info("[SD] inited")
except FileNotFoundError: except FileNotFoundError:
logger.error(f"[SD] init failed, {config_path} not found")
logger.warn(f"[SD] init failed, {config_path} not found, ignore or see https://github.com/zhayujie/chatgpt-on-wechat/tree/master/plugins/sdwebui .")
except Exception as e: except Exception as e:
logger.error("[SD] init failed, exception: %s" % e)
logger.warn("[SD] init failed, exception: %s, ignore or see https://github.com/zhayujie/chatgpt-on-wechat/tree/master/plugins/sdwebui ." % e)
def on_handle_context(self, e_context: EventContext): def on_handle_context(self, e_context: EventContext):




Loading…
Cancel
Save