Skip to content

Commit

Permalink
Update task_hook.py
Browse files Browse the repository at this point in the history
  • Loading branch information
HibiKier authored Feb 25, 2022
1 parent 1fe41dd commit 3c8983e
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions basic_plugins/hooks/task_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,20 @@ async def handle_api_call(bot: Bot, api: str, data: Dict[str, Any]):
or api == "send_group_msg"
)
and (
(r := re.search("^\[\[_task\|(.*)]]", str(data["message"]).strip()))
(
r := re.search(
"^\[\[_task\|(.*)]]",
data["message"].strip()
if isinstance(data["message"], str)
else str(data["message"]["text"]).strip(),
)
)
or (
r := re.search(
"^[[_task\|(.*)]]", str(data["message"]).strip()
"^[[_task\|(.*)]]",
data["message"].strip()
if isinstance(data["message"], str)
else str(data["message"]["text"]).strip(),
)
)
)
Expand Down

0 comments on commit 3c8983e

Please sign in to comment.