1
0
Fork 0
mirror of https://github.com/myned/modufur.git synced 2024-12-25 06:37:29 +00:00

Added redundant check for image position input (> 0)

This commit is contained in:
Myned 2017-10-21 16:44:05 -04:00
parent 82729dc6c1
commit f96b5270c9

View file

@ -530,7 +530,7 @@ class MsG:
def on_message(msg): def on_message(msg):
if msg.content.isdigit(): if msg.content.isdigit():
if int(msg.content) <= len(posts) and msg.author is ctx.author and msg.channel is ctx.channel: if 1 <= int(msg.content) <= len(posts) and msg.author is ctx.author and msg.channel is ctx.channel:
return True return True
return False return False
@ -692,9 +692,9 @@ class MsG:
posts[post['id']] = {'author': post['author'], 'url': post['file_url']} posts[post['id']] = {'author': post['author'], 'url': post['file_url']}
if len(posts) == limit: if len(posts) == limit:
break break
c += 1 c += 1
return posts return posts
@commands.command(name='e621p', aliases=['e6p', '6p']) @commands.command(name='e621p', aliases=['e6p', '6p'])
@checks.del_ctx() @checks.del_ctx()
@ -715,7 +715,7 @@ class MsG:
def on_message(msg): def on_message(msg):
if msg.content.isdigit(): if msg.content.isdigit():
if int(msg.content) <= len(posts) and msg.author is ctx.author and msg.channel is ctx.channel: if 1 <= int(msg.content) <= len(posts) and msg.author is ctx.author and msg.channel is ctx.channel:
return True return True
return False return False