forked from mdc-ng/mdc_mbot_plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
__init__.py
33 lines (29 loc) · 930 Bytes
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import logging
from mbot.core.plugins import (
plugin,
PluginMeta,
)
from typing import Dict, Any
from .command import *
from .config import *
from .event import *
_LOGGER = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)
@plugin.after_setup
def after_setup(plugin_meta: PluginMeta, config: Dict[str, Any]):
init_config(config)
try:
if os.path.isfile(bin_path):
run_command(
[
"./mdc_ng",
"-v",
],
True,
cwd=pathlib.Path(__file__).parent.absolute(),
)
else:
_LOGGER.error("MDC基础库加载失败, 请尝试在插件管理页面配置代理、手动更新MDC lib")
except Exception as e:
_LOGGER.error(e)
_LOGGER.error("MDC基础库加载失败, 请尝试在插件管理页面配置代理、手动更新MDC lib")