mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2026-05-09 18:27:56 +08:00
✨ rename bison_theme_use_browser -> bison_use_browser
This commit is contained in:
@@ -11,7 +11,7 @@ class ThemeManager:
|
||||
logger.trace(f"Registering theme: {theme}")
|
||||
if theme.name in self.__themes:
|
||||
raise ThemeRegistrationError(f"Theme {theme.name} duplicated registration")
|
||||
if theme.need_browser and not plugin_config.bison_theme_use_browser:
|
||||
if theme.need_browser and not plugin_config.bison_use_browser:
|
||||
logger.opt(colors=True).warning(f"Theme <b><u>{theme.name}</u></b> requires browser, but not allowed")
|
||||
self.__themes[theme.name] = theme
|
||||
logger.opt(colors=True).success(f"Theme <b><u>{theme.name}</u></b> registered")
|
||||
|
||||
@@ -23,8 +23,8 @@ class Theme(ABC, BaseModel):
|
||||
|
||||
async def is_support_render(self, post: "AbstractPost") -> bool:
|
||||
"""是否支持渲染该类型的Post"""
|
||||
if self.need_browser and not plugin_config.bison_theme_use_browser:
|
||||
logger.warning(f"Theme {self.name} need browser, but `bison_theme_use_browser` is False")
|
||||
if self.need_browser and not plugin_config.bison_use_browser:
|
||||
logger.warning(f"Theme {self.name} need browser, but `bison_use_browser` is False")
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user