1
0
Fork 0
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:
Myned 2017-11-06 23:49:10 -05:00
parent c5a2480cb7
commit 1ccd79d64c

View file

@ -875,6 +875,7 @@ class MsG:
keys = list(posts.keys())
values = list(posts.values())
if c < len(keys):
c += 1
embed.title = values[c - 1]['artist']
embed.url = 'https://e621.net/post/show/{}'.format(keys[c - 1])
@ -883,9 +884,9 @@ class MsG:
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)
except IndexError:
else:
await paginator.edit(content='**No more images found**')
except exc.NotFound:
await paginator.edit(content='**No more images found**')
@ -1040,6 +1041,7 @@ class MsG:
keys = list(posts.keys())
values = list(posts.values())
if c < len(keys):
c += 1
embed.title = values[c - 1]['artist']
embed.url = 'https://e926.net/post/show/{}'.format(keys[c - 1])
@ -1048,9 +1050,9 @@ class MsG:
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)
except IndexError:
else:
await paginator.edit(content='**No more images found**')
except exc.NotFound:
await paginator.edit(content='**No more images found**')