1
0
Fork 0
mirror of https://github.com/myned/modufur.git synced 2024-12-24 14:27:27 +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):
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 False
@ -692,9 +692,9 @@ class MsG:
posts[post['id']] = {'author': post['author'], 'url': post['file_url']}
if len(posts) == limit:
break
c += 1
c += 1
return posts
return posts
@commands.command(name='e621p', aliases=['e6p', '6p'])
@checks.del_ctx()
@ -715,7 +715,7 @@ class MsG:
def on_message(msg):
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 False