mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-21 22:58:05 +00:00
🐛 Fix IndexError
in PostPlugin
This commit is contained in:
parent
94c0b249cb
commit
95d488625a
@ -331,7 +331,7 @@ class Post(Plugin.Conversation):
|
||||
try:
|
||||
if len(post_images) > 1:
|
||||
media = [self.input_media(img_info) for img_info in post_images if not img_info.is_error]
|
||||
index = ((math.ceil(len(media) / 10) - 1) * 10 + 1) if len(media) > 10 else 0
|
||||
index = (math.ceil(len(media) / 10) - 1) * 10
|
||||
media[index].caption = post_text
|
||||
media[index].parse_mode = ParseMode.MARKDOWN_V2
|
||||
for group in ArkoWrapper(media).group(10): # 每 10 张图片分一个组
|
||||
@ -507,7 +507,7 @@ class Post(Plugin.Conversation):
|
||||
try:
|
||||
if len(post_images) > 1:
|
||||
media = [self.input_media(img_info) for img_info in post_images if not img_info.is_error]
|
||||
index = ((math.ceil(len(media) / 10) - 1) * 10 + 1) if len(media) > 10 else 0
|
||||
index = (math.ceil(len(media) / 10) - 1) * 10
|
||||
media[index].caption = post_text
|
||||
media[index].parse_mode = ParseMode.MARKDOWN_V2
|
||||
for group in ArkoWrapper(media).group(10): # 每 10 张图片分一个组
|
||||
|
Loading…
Reference in New Issue
Block a user