Skip to content

Commit

Permalink
🐛 change send message for InteractionCreateEvent of qq adapter(#68)
Browse files Browse the repository at this point in the history
* support qq adapter group and c2c recall

* 🚨 auto fix by pre-commit hooks

* 判断是否为target

* fix bug

* 让类型好看点qw

* Fix: InteractionCreateEvent send message

* 🚨 auto fix by pre-commit hooks

* ok,fix indentation

* 🚨 auto fix by pre-commit hooks

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
Decrabbityyy and pre-commit-ci[bot] authored Aug 10, 2024
1 parent e01c88c commit 9d24239
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/nonebot_plugin_alconna/uniseg/adapters/qq/exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ def get_target(self, event: Event, bot: Union[Bot, None] = None) -> Target:
adapter=self.get_adapter(),
self_id=bot.self_id if bot else None,
scope=SupportScope.qq_api,
extra={"qq.interaction": True},
)
elif event.channel_id:
return Target(
Expand Down Expand Up @@ -387,6 +388,9 @@ async def send_to(self, target: Union[Target, Event], bot: Bot, message: Message
res = await bot.send_to_c2c(
openid=target.id, message=message, msg_id=target.source, msg_seq=target.extra["qq.reply_seq"], **kwargs
)
elif target.extra.get("qq.interaction", False):
res = await bot.send_to_group(group_openid=target.id, message=message, event_id=target.source, **kwargs)
return res
else:
res = await bot.send_to_group(
group_openid=target.id,
Expand All @@ -395,6 +399,7 @@ async def send_to(self, target: Union[Target, Event], bot: Bot, message: Message
msg_seq=target.extra["qq.reply_seq"],
**kwargs,
)

target.extra["qq.reply_seq"] += 1
return res

Expand Down

0 comments on commit 9d24239

Please sign in to comment.