Skip to content

Commit

Permalink
update feishu adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
MeetWq committed Oct 25, 2023
1 parent fb0abd5 commit 215c843
Show file tree
Hide file tree
Showing 4 changed files with 456 additions and 344 deletions.
6 changes: 3 additions & 3 deletions nonebot_plugin_saa/adapters/feishu.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@

try:
import httpx
from nonebot.adapters.feishu.message import At
from nonebot.adapters.feishu import (
Bot,
Message,
MessageEvent,
MessageSegment,
GroupMessageEvent,
MessageSerializer,
PrivateMessageEvent,
)

Expand Down Expand Up @@ -74,7 +74,7 @@ async def _image(i: Image, bot: BaseBot) -> MessageSegment:

@register_feishu(Mention)
def _mention(m: Mention) -> MessageSegment:
return MessageSegment.at(m.data["user_id"])
return At("at", {"user_id": m.data["user_id"]})

@register_feishu(Reply)
def _reply(r: Reply) -> MessageSegment:
Expand Down Expand Up @@ -149,7 +149,7 @@ async def send(
message_segment = await message_segment_factory.build(bot)
message_to_send += message_segment

msg_type, content = MessageSerializer(message_to_send).serialize()
msg_type, content = message_to_send.serialize()

if reply_to_message_id is None:
if isinstance(target, TargetFeishuGroup):
Expand Down
Loading

0 comments on commit 215c843

Please sign in to comment.