diff options
Diffstat (limited to 'ATRI')
| -rw-r--r-- | ATRI/configs/__init__.py | 2 | ||||
| -rw-r--r-- | ATRI/configs/config.py | 11 | ||||
| -rw-r--r-- | ATRI/message.py | 2 | ||||
| -rw-r--r-- | ATRI/plugins/console/__init__.py | 2 | ||||
| -rw-r--r-- | ATRI/plugins/repo.py | 4 | ||||
| -rw-r--r-- | ATRI/plugins/twitter/data_source.py | 4 | 
6 files changed, 11 insertions, 14 deletions
| diff --git a/ATRI/configs/__init__.py b/ATRI/configs/__init__.py index 3558f42..cca5d9b 100644 --- a/ATRI/configs/__init__.py +++ b/ATRI/configs/__init__.py @@ -1 +1 @@ -from .config import Config
\ No newline at end of file +from .config import Config diff --git a/ATRI/configs/config.py b/ATRI/configs/config.py index e944a43..e691c65 100644 --- a/ATRI/configs/config.py +++ b/ATRI/configs/config.py @@ -4,12 +4,7 @@ from pathlib import Path  from ATRI.log import log -from .models import ( -    BotConfig, -    ConfigModel, -    WithGoCQHTTP, -    RuntimeConfig -) +from .models import BotConfig, ConfigModel, WithGoCQHTTP, RuntimeConfig  _DEFAULT_CONFIG_PATH = Path(".") / "ATRI" / "configs" / "default_config.yml" @@ -43,7 +38,7 @@ class Config:      def parse(self) -> ConfigModel:          return ConfigModel.parse_obj(self.config) -     +      def get_runtime_conf(self) -> dict:          bot_conf = BotConfig.parse_obj(self.config["BotConfig"])          gocq_conf = WithGoCQHTTP.parse_obj(self.config["WithGoCQHTTP"]) @@ -59,5 +54,5 @@ class Config:              session_expire_timeout=bot_conf.session_expire_timeout,              gocq_accoutns=gocq_conf.accounts,              gocq_download_domain=gocq_conf.download_version, -            gocq_version=gocq_conf.download_version +            gocq_version=gocq_conf.download_version,          ).dict() diff --git a/ATRI/message.py b/ATRI/message.py index fb31ef5..4a54824 100644 --- a/ATRI/message.py +++ b/ATRI/message.py @@ -34,6 +34,6 @@ class MessageBuilder(Message):              text = "\n" + text          self.append(MessageSegment.text(text))          return self -     +      def done(self) -> str:          return str().join(map(str, self)) diff --git a/ATRI/plugins/console/__init__.py b/ATRI/plugins/console/__init__.py index 522998d..ea109dc 100644 --- a/ATRI/plugins/console/__init__.py +++ b/ATRI/plugins/console/__init__.py @@ -41,7 +41,7 @@ async def _(event: PrivateMessageEvent, is_pub_n: str = ArgPlainText("is_pub_n")          .text(f"Token: {token}")          .text("该 token 有效时间为 15min")      ) -     +      await gen_console_key.finish(msg) diff --git a/ATRI/plugins/repo.py b/ATRI/plugins/repo.py index 2b0962f..1c53d58 100644 --- a/ATRI/plugins/repo.py +++ b/ATRI/plugins/repo.py @@ -14,6 +14,7 @@ from ATRI.message import MessageBuilder  _repo_flmt_notice = choice(["慢...慢一..点❤", "冷静1下", "歇会歇会~~"]) +<<<<<<< HEAD  _REPO_FORMAT = (      MessageBuilder("来自用户{user}反馈:")      .text("{msg}") @@ -21,6 +22,9 @@ _REPO_FORMAT = (      .text("- 无需担心, 关注其它内容即可")      .done()  ) +======= +_REPO_FORMAT = MessageBuilder("来自用户{user}反馈:").text("{msg}").done() +>>>>>>> 83a9fb95251c173b2394b668aab1b63908af5f29  repo = Service("反馈", "向维护者发送消息", rule=is_in_service("反馈")) diff --git a/ATRI/plugins/twitter/data_source.py b/ATRI/plugins/twitter/data_source.py index 18a8fb9..8f3e793 100644 --- a/ATRI/plugins/twitter/data_source.py +++ b/ATRI/plugins/twitter/data_source.py @@ -17,9 +17,7 @@ from .api import API  _DYNAMIC_OUTPUT_FORMAT = ( -    MessageBuilder("{t_nickname} 的推更新了!") -    .text("{t_dy_content}") -    .done() +    MessageBuilder("{t_nickname} 的推更新了!").text("{t_dy_content}").done()  ) | 
