Adding back check cause I'm dumb dumb

pull/8/head
sgoudham 4 years ago
parent 510cd38f46
commit 254e2da8b0

@ -567,37 +567,39 @@ class Moderation(Cog):
new_roles = [roles for roles in after.roles if roles not in before.roles] new_roles = [roles for roles in after.roles if roles not in before.roles]
old_roles = [roles for roles in before.roles if roles not in after.roles] old_roles = [roles for roles in before.roles if roles not in after.roles]
new_roles_string = ", ".join(f"`{r.name}`" for r in new_roles) if len(new_roles) >= 1:
new_roles_string = ", ".join(f"`{r.name}`" for r in new_roles)
if len(new_roles) == 1:
desc = f"**{after.mention} was given the role** `{new_roles_string}`" if len(new_roles) == 1:
else: desc = f"**{after.mention} was given the role** `{new_roles_string}`"
new_roles_string = ",".join(f"`{r.name}`" for r in new_roles) else:
desc = f"**Roles Added To {after.mention}\nRoles:** {new_roles_string}" new_roles_string = ",".join(f"`{r.name}`" for r in new_roles)
desc = f"**Roles Added To {after.mention}\nRoles:** {new_roles_string}"
embed = Embed(description=desc,
colour=enso_embedmod_colours, embed = Embed(description=desc,
timestamp=datetime.datetime.utcnow()) colour=enso_embedmod_colours,
embed.set_author(name=after, icon_url=after.avatar_url) timestamp=datetime.datetime.utcnow())
embed.set_footer(text=f"ID: {after.id}") embed.set_author(name=after, icon_url=after.avatar_url)
embed.set_footer(text=f"ID: {after.id}")
await modlogs_channel.send(embed=embed)
await modlogs_channel.send(embed=embed)
old_roles_string = ", ".join(r.name for r in old_roles)
if len(old_roles) >= 1:
if len(old_roles) == 1: old_roles_string = ", ".join(r.name for r in old_roles)
desc = f"**{after.mention} was removed from the role `{old_roles_string}`**"
else: if len(old_roles) == 1:
old_roles_string = ",".join(f"`{r.name}`" for r in old_roles) desc = f"**{after.mention} was removed from the role `{old_roles_string}`**"
desc = f"**Roles Removed From {after.mention}\nRoles: {old_roles_string}**" else:
old_roles_string = ",".join(f"`{r.name}`" for r in old_roles)
embed = Embed(description=desc, desc = f"**Roles Removed From {after.mention}\nRoles: {old_roles_string}**"
colour=enso_embedmod_colours,
timestamp=datetime.datetime.utcnow()) embed = Embed(description=desc,
embed.set_author(name=after, icon_url=after.avatar_url) colour=enso_embedmod_colours,
embed.set_footer(text=f"ID: {after.id}") timestamp=datetime.datetime.utcnow())
embed.set_author(name=after, icon_url=after.avatar_url)
await modlogs_channel.send(embed=embed) embed.set_footer(text=f"ID: {after.id}")
await modlogs_channel.send(embed=embed)
def setup(bot): def setup(bot):

Loading…
Cancel
Save