Compare commits

...
Author SHA1 Message Date
overwriter d90a6bd19a Merge e93fc1463e into da6d5b4be4 2025-07-24 15:59:34 +08:00
overwriter e93fc1463e feat: 根据平台区分 2025-07-22 22:27:04 +08:00
pre-commit-ci[bot] 429a05ac69 🚨 auto fix by pre-commit hooks 2025-07-17 13:22:03 +00:00
overwriter 66d7336acb feat: 增加戳一戳小工具 2025-07-17 07:58:58 +08:00
+28
View File
@@ -487,6 +487,34 @@ class PlatformUtils:
target = Target(user_id, private=True)
return target
@classmethod
async def poke(
cls,
bot: Bot,
user_id: str,
group_id: str | None = None,
) -> bool:
"""发送戳一戳
参数:
bot: Bot
user_id: 用户id
group_id: 群组id
"""
platform = PlatformUtils.get_platform(bot)
if platform == "qq":
await bot.call_api("send_poke", user_id=user_id, group_id=group_id)
else:
try:
await bot.call_api("poke", qq=user_id)
except Exception:
logger.warning(
"戳一戳发送失败,可能是协议端不支持...",
"发送戳一戳",
)
return False
return True
class BroadcastEngine:
def __init__(