diff options
author | 2019-09-25 15:40:39 -0500 | |
---|---|---|
committer | 2019-09-25 15:40:39 -0500 | |
commit | 5c1f56dd756da8e1e5d4e6f53c5cd4c8569b459a (patch) | |
tree | de03fc664e96b6254bcab4de14c0d568b87a932a | |
parent | Free 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.py | 3 |
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: |