Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support qq adapter group and c2c recall #66

Merged
merged 5 commits into from
Aug 9, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/nonebot_plugin_alconna/uniseg/adapters/qq/exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from nonebot.adapters.qq.message import Message, MessageSegment
from nonebot.adapters.qq.models.common import Button as ButtonModel
from nonebot.adapters.qq.models.guild import Message as GuildMessage
from nonebot.adapters.qq.models import PostC2CMessagesReturn, PostGroupMessagesReturn
from nonebot.adapters.qq.models.common import Permission, RenderData, InlineKeyboard, MessageKeyboard, InlineKeyboardRow
from nonebot.adapters.qq.event import (
ForumEvent,
Expand Down Expand Up @@ -420,6 +421,20 @@ async def recall(self, mid: Any, bot: Bot, context: Union[Target, Event]):
channel_id=mid.channel_id,
message_id=mid.id,
)
elif isinstance(context, GroupAtMessageCreateEvent):
if isinstance(mid, PostGroupMessagesReturn):

await bot.delete_group_message(
group_openid=context.group_openid,
message_id=mid.id, # type: ignore
)
elif isinstance(context, C2CMessageCreateEvent):
if isinstance(mid, PostC2CMessagesReturn):
await bot.delete_c2c_message(
openid=context.author.id,
message_id=mid.id, # type: ignore
)

Decrabbityyy marked this conversation as resolved.
Show resolved Hide resolved
return

def get_reply(self, mid: Any):
Expand Down