Simplifying Code for User Roles

pull/8/head
sgoudham 4 years ago
parent 27f8284b8f
commit 25fc15a705

@ -62,12 +62,9 @@ class GetInfo(commands.Cog):
# Get the member avatar # Get the member avatar
userAvatar = target.avatar_url userAvatar = target.avatar_url
# Get all the roles of the user # Store all the roles that the user has
mentions = [role.mention for role in target.roles] # (Skipping the first element as it's always going to be @everyone)
roles = f"{' '.join(map(str, (role.mention for role in target.roles[1:])))}"
# Store the roles in a string called "roles"
# For each role that the user has (Skipping the first element as it's always going to be @everyone)
roles = " ".join(mentions[1:])
# Returns the permissions that the user has within the guild # Returns the permissions that the user has within the guild
filtered = filter(lambda x: x[1], target.guild_permissions) filtered = filter(lambda x: x[1], target.guild_permissions)

Loading…
Cancel
Save