Skip to content

Commit 06afb53

Browse files
author
veehou
committed
fix: 修复撤回消息隐藏小灰条没有生效的问题
1 parent 6c37dd6 commit 06afb53

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

botpy/api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ async def post_message(
517517
route = Route("POST", "/channels/{channel_id}/messages", channel_id=channel_id)
518518
return await self._http.request(route, json=payload)
519519

520-
async def recall_message(self, channel_id: str, message_id: str, hide_tip: bool = False) -> str:
520+
async def recall_message(self, channel_id: str, message_id: str, hidetip: bool = False) -> str:
521521
"""
522522
撤回消息。
523523
@@ -528,12 +528,12 @@ async def recall_message(self, channel_id: str, message_id: str, hide_tip: bool
528528
Args:
529529
channel_id (str): 您要将消息发送到的频道的 ID。
530530
message_id (str): 要撤回的消息的 ID。
531-
hide_tip (bool): 是否隐藏撤回提示小灰条。. Defaults to False
531+
hidetip (bool): 是否隐藏撤回提示小灰条。. Defaults to False
532532
533533
Returns:
534534
成功执行返回`None`。
535535
"""
536-
params = {"hide_tip": "true" if hide_tip else "false"}
536+
params = {"hidetip": "true" if hidetip else "false"}
537537

538538
route = Route(
539539
"DELETE",

examples/demo_recall.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ async def on_ready(self):
1919

2020
async def on_at_message_create(self, message: Message):
2121
_message = await message.reply(content=f"机器人{self.robot.name}收到你的@消息了: {message.content}")
22-
await self.api.recall_message(message.channel_id, _message.get("id"))
22+
await self.api.recall_message(message.channel_id, _message.get("id"), hidetip=True)
2323

2424

2525
if __name__ == "__main__":

0 commit comments

Comments
 (0)