Skip to content

Commit

Permalink
replace event.message
Browse files Browse the repository at this point in the history
  • Loading branch information
MeetWq committed Sep 13, 2024
1 parent 6812f65 commit ace6087
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions nonebot_plugin_chatrecorder/adapters/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ async def record_recv_msg(bot: Bot, event: MessageEvent):
time=remove_timezone(event.time.astimezone(timezone.utc)),
type=record_type(event),
message_id=await get_id(),
message=serialize_message(adapter, event.message),
plain_text=event.message.extract_plain_text(),
message=serialize_message(adapter, event.get_message()),
plain_text=event.get_plaintext(),
)
async with get_session() as db_session:
db_session.add(record)
Expand Down
4 changes: 2 additions & 2 deletions nonebot_plugin_chatrecorder/adapters/dodo.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ async def record_recv_msg(bot: Bot, event: MessageEvent):
time=remove_timezone(event.timestamp),
type=record_type(event),
message_id=event.message_id,
message=serialize_message(adapter, event.message),
plain_text=event.message.extract_plain_text(),
message=serialize_message(adapter, event.get_message()),
plain_text=event.get_plaintext(),
)
async with get_session() as db_session:
db_session.add(record)
Expand Down
2 changes: 1 addition & 1 deletion nonebot_plugin_chatrecorder/adapters/feishu.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async def record_recv_msg(bot: Bot, event: MessageEvent):
type=record_type(event),
message_id=event.event.message.message_id,
message=serialize_message(adapter, event.get_message()),
plain_text=event.get_message().extract_plain_text(),
plain_text=event.get_plaintext(),
)
async with get_session() as db_session:
db_session.add(record)
Expand Down
4 changes: 2 additions & 2 deletions nonebot_plugin_chatrecorder/adapters/kaiheila.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ async def record_recv_msg(bot: Bot, event: MessageEvent):
),
type=record_type(event),
message_id=event.msg_id,
message=serialize_message(adapter, event.message),
plain_text=event.message.extract_plain_text(),
message=serialize_message(adapter, event.get_message()),
plain_text=event.get_plaintext(),
)
async with get_session() as db_session:
db_session.add(record)
Expand Down
4 changes: 2 additions & 2 deletions nonebot_plugin_chatrecorder/adapters/onebot_v11.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ async def record_recv_msg(bot: Bot, event: MessageEvent):
time=remove_timezone(datetime.fromtimestamp(event.time, timezone.utc)),
type=record_type(event),
message_id=str(event.message_id),
message=serialize_message(adapter, event.message),
plain_text=event.message.extract_plain_text(),
message=serialize_message(adapter, event.get_message()),
plain_text=event.get_plaintext(),
)
async with get_session() as db_session:
db_session.add(record)
Expand Down
4 changes: 2 additions & 2 deletions nonebot_plugin_chatrecorder/adapters/onebot_v12.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ async def record_recv_msg(bot: Bot, event: MessageEvent):
time=remove_timezone(event.time),
type=record_type(event),
message_id=event.message_id,
message=serialize_message(adapter, event.message),
plain_text=event.message.extract_plain_text(),
message=serialize_message(adapter, event.get_message()),
plain_text=event.get_plaintext(),
)
async with get_session() as db_session:
db_session.add(record)
Expand Down
4 changes: 2 additions & 2 deletions nonebot_plugin_chatrecorder/adapters/red.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ async def record_recv_msg(bot: Bot, event: MessageEvent):
),
type=record_type(event),
message_id=event.msgId,
message=serialize_message(adapter, event.message),
plain_text=event.message.extract_plain_text(),
message=serialize_message(adapter, event.get_message()),
plain_text=event.get_plaintext(),
)
async with get_session() as db_session:
db_session.add(record)
Expand Down
4 changes: 2 additions & 2 deletions nonebot_plugin_chatrecorder/adapters/telegram.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ async def record_recv_msg(bot: Bot, event: MessageEvent):
time=remove_timezone(datetime.fromtimestamp(event.date, timezone.utc)),
type=record_type(event),
message_id=f"{event.chat.id}_{event.message_id}",
message=serialize_message(adapter, event.message),
plain_text=event.message.extract_plain_text(),
message=serialize_message(adapter, event.get_message()),
plain_text=event.get_plaintext(),
)
async with get_session() as db_session:
db_session.add(record)
Expand Down

0 comments on commit ace6087

Please sign in to comment.