Skip to content

Commit 1a777b7

Browse files
committed
Fixes #1
1 parent c585311 commit 1a777b7

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

giveaway/giveaway.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ async def create_embed(self,
217217

218218
if winners is not None:
219219
embed.color = 0xffffff
220-
if type(winners) == list:
220+
if isinstance(winners, list):
221221
winners_list = [str(user.mention) for user in winners]
222222
winners_str = human_join(winners_list, final='and')
223223
else:
@@ -270,10 +270,13 @@ async def end(self, *, update_config=True):
270270
return
271271

272272
users = await reaction.users().flatten()
273-
try:
274-
users.remove(self.guild.me)
275-
except ValueError:
276-
pass
273+
274+
# This will let the bot win if no one entered the giveaway ;(
275+
if len(users) > 1:
276+
try:
277+
users.remove(self.guild.me)
278+
except ValueError:
279+
pass
277280

278281
now = datetime.datetime.utcnow()
279282

0 commit comments

Comments
 (0)