From 472dd0780e26a897115caf5441a9bdaedaaa8901 Mon Sep 17 00:00:00 2001 From: sgoudham Date: Sun, 12 Jul 2020 04:53:15 +0100 Subject: [PATCH] Making code more efficient Using map/.join/filter/lambda --- cogs/help/info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cogs/help/info.py b/cogs/help/info.py index eea63df7..9fd40f55 100644 --- a/cogs/help/info.py +++ b/cogs/help/info.py @@ -74,7 +74,7 @@ class GetInfo(commands.Cog): filtered = filter(lambda x: x[1], target.guild_permissions) # now replace all "_" with " " in each item and join them together permission = ",".join(map(lambda x: x[0].replace("_", " "), filtered)) - + # Capitalise every word in the array and get rid of the ", " at the end of the string permissions = string.capwords("".join(map(str, DetectPermissions(permission, Perms))))