Skip to content

Commit

Permalink
fix message format
Browse files Browse the repository at this point in the history
  • Loading branch information
jxxghp committed Sep 22, 2023
1 parent 7f6beb2 commit c8ae6bc
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions app/modules/synologychat/synologychat.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,18 @@ def send_meidas_msg(self, medias: List[MediaInfo], userid: str = "", title: str
if not image:
image = media.get_message_image()
if media.vote_average:
caption = "%s\n%s. [%s](%s)\n_%s,%s_" % (caption,
index,
media.title_year,
media.detail_link,
f"类型:{media.type.value}",
f"评分:{media.vote_average}")
caption = "%s\n%s. <%s|%s>\n_%s,%s_" % (caption,
index,
media.detail_link,
media.title_year,
f"类型:{media.type.value}",
f"评分:{media.vote_average}")
else:
caption = "%s\n%s. [%s](%s)\n_%s_" % (caption,
index,
media.title_year,
media.detail_link,
f"类型:{media.type.value}")
caption = "%s\n%s. <%s|%s>\n_%s_" % (caption,
index,
media.detail_link,
media.title_year,
f"类型:{media.type.value}")
index += 1

if userid:
Expand All @@ -108,7 +108,6 @@ def send_meidas_msg(self, medias: List[MediaInfo], userid: str = "", title: str
userids = self.__get_bot_users()
payload_data = {
"text": quote(caption),
"file_url": quote(image),
"user_ids": userids
}
return self.__send_request(payload_data)
Expand Down Expand Up @@ -143,7 +142,7 @@ def send_torrents_msg(self, torrents: List[Context],
free = torrent.volume_factor
seeder = f"{torrent.seeders}↑"
description = torrent.description
caption = f"{caption}\n{index}.【{site_name}[{title}]({link}) " \
caption = f"{caption}\n{index}.【{site_name}<{link}|{title}> " \
f"{StringUtils.str_filesize(torrent.size)} {free} {seeder}\n" \
f"_{description}_"
index += 1
Expand Down

0 comments on commit c8ae6bc

Please sign in to comment.