mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-05 03:39:59 +08:00
修复签到好感度进度条错误
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
from typing import Tuple, Union, Dict
|
||||
from nonebot.adapters.onebot.v11 import MessageEvent, PrivateMessageEvent, GroupMessageEvent
|
||||
from typing import Dict, Optional, Tuple, Union
|
||||
|
||||
from nonebot.adapters.onebot.v11 import (
|
||||
GroupMessageEvent,
|
||||
MessageEvent,
|
||||
PrivateMessageEvent,
|
||||
)
|
||||
|
||||
|
||||
class WithdrawMessageManager:
|
||||
@@ -27,7 +32,10 @@ class WithdrawMessageManager:
|
||||
self.data.remove(message_data)
|
||||
|
||||
def withdraw_message(
|
||||
self, event: MessageEvent, id_: Union[int, Dict[str, int]], conditions: Tuple[int, int]
|
||||
self,
|
||||
event: MessageEvent,
|
||||
id_: Union[int, Dict[str, int]],
|
||||
conditions: Optional[Tuple[int, int]],
|
||||
):
|
||||
"""
|
||||
便捷判断消息撤回
|
||||
@@ -35,7 +43,7 @@ class WithdrawMessageManager:
|
||||
:param id_: 消息id 或 send 返回的字典
|
||||
:param conditions: 判断条件
|
||||
"""
|
||||
if conditions[0]:
|
||||
if conditions and conditions[0]:
|
||||
if (
|
||||
(conditions[1] == 0 and isinstance(event, PrivateMessageEvent))
|
||||
or (conditions[1] == 1 and isinstance(event, GroupMessageEvent))
|
||||
|
||||
Reference in New Issue
Block a user