Skip to content

Commit

Permalink
🔖 version 0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
RF-Tar-Railt committed Oct 13, 2023
1 parent 1ace0f9 commit 69bb6fe
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion nonebot/adapters/red/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
from .event import GroupMessageEvent as GroupMessageEvent
from .event import PrivateMessageEvent as PrivateMessageEvent

__version__ = "0.5.2"
__version__ = "0.6.0"
8 changes: 5 additions & 3 deletions nonebot/adapters/red/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ async def startup(self) -> None:
log(
"WARNING",
"No bots found in config! \n"
"Please check your config file and make sure it's correct."
"Please check your config file and make sure it's correct.",
)
for bot in self._bots:
self.tasks.append(asyncio.create_task(self._forward_ws(bot)))
Expand Down Expand Up @@ -128,8 +128,10 @@ async def _forward_ws(self, bot_info: BotInfo) -> None:
# 尝试重连
log(
"ERROR",
"<r><bg #f8bbd0>Error while setup websocket to "
f"{ws_url}. Trying to reconnect...</bg #f8bbd0></r>",
"<r><bg #f8bbd0>"
"Error while setup websocket to "
f"{escape_tag(str(ws_url))}. Trying to reconnect..."
f"</bg #f8bbd0></r>",
e,
)
await asyncio.sleep(3) # 重连间隔
Expand Down
2 changes: 2 additions & 0 deletions nonebot/adapters/red/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,12 @@ def convert(cls, obj: Any):
operatorName=obj.elements[0].grayTipElement.groupElement.memberNick, # type: ignore # noqa: E501
)


legacy_invite_message = re.compile(
r'jp="(\d+)".*jp="(\d+)"', re.DOTALL | re.MULTILINE | re.IGNORECASE
)


class MemberAddEvent(NoticeEvent):
"""群成员增加事件"""

Expand Down
4 changes: 3 additions & 1 deletion nonebot/adapters/red/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ def file(file: Union[str, Path, BytesIO, bytes]) -> "MessageSegment":
return MediaMessageSegment("file", {"file": file})

@staticmethod
def voice(file: Union[str, Path, BytesIO, bytes], duration: int = 1) -> "MessageSegment":
def voice(
file: Union[str, Path, BytesIO, bytes], duration: int = 1
) -> "MessageSegment":
if isinstance(file, str):
file = Path(file)
if isinstance(file, Path):
Expand Down

0 comments on commit 69bb6fe

Please sign in to comment.