aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Daniel Brown <[email protected]>2019-09-25 14:49:34 -0500
committerGravatar Daniel Brown <[email protected]>2019-09-25 14:49:34 -0500
commite02accae0730b92b4630ababfdcc5f5931effaff (patch)
treebe8a386b6c03f300d7b50e7ed35b4540103dc4aa
parentFree Command Fix (diff)
Free Command Fix
- Moved the sorted function to its own line and instead passed the generated list for code clarity. Signed-off-by: Daniel Brown <[email protected]>
-rw-r--r--bot/cogs/free.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/bot/cogs/free.py b/bot/cogs/free.py
index ec8834240..bc84aae3f 100644
--- a/bot/cogs/free.py
+++ b/bot/cogs/free.py
@@ -79,8 +79,8 @@ 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
- for i, (inactive, channel) in enumerate(
- sorted(free_channels, key=lambda free_channel: free_channel[0], reverse=True), 1):
+ sorted_channels = sorted(free_channels, key=lambda free_channel: free_channel[0], reverse=True)
+ for i, (inactive, channel) in enumerate(sorted_channels, 1):
minutes, seconds = divmod(inactive, 60)
if minutes > 59:
hours, minutes = divmod(minutes, 60)