Merge pull request #50 from xuqian13/feat/videourl

feat:发送视频消息
pull/51/head
UnCLAS-Prommer 2025-07-07 15:45:02 +08:00 committed by GitHub
commit e44fe1ac6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 0 deletions

View File

@ -175,6 +175,9 @@ class SendHandler:
elif seg.type == "music":
song_id = seg.data
new_payload = self.build_payload(payload, self.handle_music_message(song_id), False)
elif seg.type == "videourl":
video_url = seg.data
new_payload = self.build_payload(payload, self.handle_videourl_message(video_url), False)
return new_payload
def build_payload(self, payload: list, addon: dict, is_reply: bool = False) -> list:
@ -251,6 +254,12 @@ class SendHandler:
"type": "music",
"data": {"type": "163", "id": song_id},
}
def handle_videourl_message(self, video_url: str) -> dict:
"""处理视频链接消息"""
return {
"type": "video",
"data": {"file": video_url},
}
def handle_ban_command(self, args: Dict[str, Any], group_info: GroupInfo) -> Tuple[str, Dict[str, Any]]:
"""处理封禁命令