mirror of
https://github.com/myned/modufur.git
synced 2024-12-24 14:27:27 +00:00
Fixed IndexError on hearting post after last image notification
This commit is contained in:
parent
c5a2480cb7
commit
1ccd79d64c
1 changed files with 20 additions and 18 deletions
|
@ -875,17 +875,18 @@ class MsG:
|
||||||
keys = list(posts.keys())
|
keys = list(posts.keys())
|
||||||
values = list(posts.values())
|
values = list(posts.values())
|
||||||
|
|
||||||
c += 1
|
if c < len(keys):
|
||||||
embed.title = values[c - 1]['artist']
|
c += 1
|
||||||
embed.url = 'https://e621.net/post/show/{}'.format(keys[c - 1])
|
embed.title = values[c - 1]['artist']
|
||||||
embed.set_footer(text='{} / {}'.format(c, len(posts)),
|
embed.url = 'https://e621.net/post/show/{}'.format(keys[c - 1])
|
||||||
icon_url=self._get_score(values[c - 1]['score']))
|
embed.set_footer(text='{} / {}'.format(c, len(posts)),
|
||||||
embed.set_image(url=values[c - 1]['url'])
|
icon_url=self._get_score(values[c - 1]['score']))
|
||||||
|
embed.set_image(url=values[c - 1]['url'])
|
||||||
|
|
||||||
await paginator.edit(content='\N{HEAVY BLACK HEART}' if values[c - 1]['url'] in hearted else None, embed=embed)
|
await paginator.edit(content='\N{HEAVY BLACK HEART}' if values[c - 1]['url'] in hearted else None, embed=embed)
|
||||||
|
else:
|
||||||
|
await paginator.edit(content='**No more images found**')
|
||||||
|
|
||||||
except IndexError:
|
|
||||||
await paginator.edit(content='**No more images found**')
|
|
||||||
except exc.NotFound:
|
except exc.NotFound:
|
||||||
await paginator.edit(content='**No more images found**')
|
await paginator.edit(content='**No more images found**')
|
||||||
|
|
||||||
|
@ -1040,17 +1041,18 @@ class MsG:
|
||||||
keys = list(posts.keys())
|
keys = list(posts.keys())
|
||||||
values = list(posts.values())
|
values = list(posts.values())
|
||||||
|
|
||||||
c += 1
|
if c < len(keys):
|
||||||
embed.title = values[c - 1]['artist']
|
c += 1
|
||||||
embed.url = 'https://e926.net/post/show/{}'.format(keys[c - 1])
|
embed.title = values[c - 1]['artist']
|
||||||
embed.set_footer(text='{} / {}'.format(c, len(posts)),
|
embed.url = 'https://e926.net/post/show/{}'.format(keys[c - 1])
|
||||||
icon_url=self._get_score(values[c - 1]['score']))
|
embed.set_footer(text='{} / {}'.format(c, len(posts)),
|
||||||
embed.set_image(url=values[c - 1]['url'])
|
icon_url=self._get_score(values[c - 1]['score']))
|
||||||
|
embed.set_image(url=values[c - 1]['url'])
|
||||||
|
|
||||||
await paginator.edit(content='\N{HEAVY BLACK HEART}' if values[c - 1]['url'] in hearted else None, embed=embed)
|
await paginator.edit(content='\N{HEAVY BLACK HEART}' if values[c - 1]['url'] in hearted else None, embed=embed)
|
||||||
|
else:
|
||||||
|
await paginator.edit(content='**No more images found**')
|
||||||
|
|
||||||
except IndexError:
|
|
||||||
await paginator.edit(content='**No more images found**')
|
|
||||||
except exc.NotFound:
|
except exc.NotFound:
|
||||||
await paginator.edit(content='**No more images found**')
|
await paginator.edit(content='**No more images found**')
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue