From 0e76bcd94ce193897cf93f5c62bdd800adf61224 Mon Sep 17 00:00:00 2001
From: Rom194 <romain.ordi@gmail.com>
Date: Wed, 12 Dec 2018 00:02:14 +0100
Subject: [PATCH] Update sondage.py

optimisation
---
 cogs/sondage.py | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/cogs/sondage.py b/cogs/sondage.py
index 8162c0e..4ceae3f 100755
--- a/cogs/sondage.py
+++ b/cogs/sondage.py
@@ -19,16 +19,14 @@ class Sondage:
 			time = [x for x in options if x.startswith("time=")]
 			if time:
 				time = time[0]
-			if time:
 				options.remove(time)
-			if len(options) <= 1:
-				raise commands.errors.MissingRequiredArgument
-			if len(options) >= 21:
-				return await ctx.send(ctx.message.author.mention + "> :octagonal_sign: Vous ne pouvez pas mettre plus de 20 réponses !")
-			if time:
 				time = int(time.strip("time="))
 			else:
 				time = 0
+			if len(options) <= 1:
+				raise commands.errors.MissingRequiredArgument
+			if len(options) >= 21:
+				return await ctx.send(ctx.author.mention + "> :octagonal_sign: Vous ne pouvez pas mettre plus de 20 réponses !")
 			emoji = ['1⃣',
 					 '2⃣',
 					 '3⃣',
@@ -56,7 +54,7 @@ class Sondage:
 				confirmation_msg += "{} - {}\n".format(emoji[idx], option)
 				to_react.append(emoji[idx])
 			confirmation_msg += "*Sondage proposé par* " + \
-								str(ctx.message.author.mention)
+								str(ctx.author.mention)
 			if time == 0:
 				confirmation_msg += ""
 			else: