mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
feat: 根据平台区分
This commit is contained in:
parent
429a05ac69
commit
e93fc1463e
@ -501,14 +501,12 @@ class PlatformUtils:
|
|||||||
user_id: 用户id
|
user_id: 用户id
|
||||||
group_id: 群组id
|
group_id: 群组id
|
||||||
"""
|
"""
|
||||||
try:
|
platform = PlatformUtils.get_platform(bot)
|
||||||
await bot.call_api("poke", qq=user_id)
|
if platform == "qq":
|
||||||
except Exception:
|
await bot.call_api("send_poke", user_id=user_id, group_id=group_id)
|
||||||
|
else:
|
||||||
try:
|
try:
|
||||||
if group_id:
|
await bot.call_api("poke", qq=user_id)
|
||||||
await bot.call_api("group_poke", user_id=user_id, group_id=group_id)
|
|
||||||
else:
|
|
||||||
await bot.call_api("friend_poke", user_id=user_id)
|
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.warning(
|
logger.warning(
|
||||||
"戳一戳发送失败,可能是协议端不支持...",
|
"戳一戳发送失败,可能是协议端不支持...",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user