aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Daniel Brown <[email protected]>2019-09-25 15:40:39 -0500
committerGravatar Daniel Brown <[email protected]>2019-09-25 15:40:39 -0500
commit5c1f56dd756da8e1e5d4e6f53c5cd4c8569b459a (patch)
treede03fc664e96b6254bcab4de14c0d568b87a932a
parentFree Command Fix (diff)
Swapped Lambda for itemgetter
- For the sake of code style and consistency, the lambda has been swapped with operator.itemgetter Signed-off-by: Daniel Brown <[email protected]>
-rw-r--r--bot/cogs/free.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/bot/cogs/free.py b/bot/cogs/free.py
index bc84aae3f..269c5c1b9 100644
--- a/bot/cogs/free.py
+++ b/bot/cogs/free.py
@@ -1,5 +1,6 @@
import logging
from datetime import datetime
+from operator import itemgetter
from discord import Colour, Embed, Member, utils
from discord.ext.commands import Bot, Cog, Context, command
@@ -79,7 +80,7 @@ class Free(Cog):
# Sort channels in descending order by seconds
# Get position in list, inactivity, and channel object
# For each channel, add to embed.description
- sorted_channels = sorted(free_channels, key=lambda free_channel: free_channel[0], reverse=True)
+ sorted_channels = sorted(free_channels, key=itemgetter(0), reverse=True)
for i, (inactive, channel) in enumerate(sorted_channels, 1):
minutes, seconds = divmod(inactive, 60)
if minutes > 59: