black refactoring

pull/174/head
bobloy 4 years ago
parent 0475b18437
commit ea88addc42

@ -227,8 +227,7 @@ class CCRole(commands.Cog):
if not role_list:
return "None"
return ", ".join(
discord.utils.get(ctx.guild.roles, id=roleid).name
for roleid in role_list
discord.utils.get(ctx.guild.roles, id=roleid).name for roleid in role_list
)
embed.add_field(name="Text", value="```{}```".format(cmd["text"]), inline=False)
@ -325,9 +324,7 @@ class CCRole(commands.Cog):
async def eval_cc(self, cmd, message: discord.Message, ctx: commands.Context):
"""Does all the work"""
if cmd["proles"] and not {role.id for role in message.author.roles} & set(
cmd["proles"]
):
if cmd["proles"] and not {role.id for role in message.author.roles} & set(cmd["proles"]):
log.debug(f"{message.author} missing required role to execute {ctx.invoked_with}")
return # Not authorized, do nothing

@ -67,10 +67,7 @@ class InfoChannel(Cog):
default_channel_ids = {k: None for k in self.default_channel_names}
# Only members is enabled by default
default_enabled_counts = {
k: k == "members" for k in self.default_channel_names
}
default_enabled_counts = {k: k == "members" for k in self.default_channel_names}
default_guild = {
"category_id": None,

@ -249,7 +249,6 @@ class PlantTycoon(commands.Cog):
if gardener.products[product] > 0
)
degradation = (
100
/ (gardener.current["time"] / 60)
@ -306,9 +305,7 @@ class PlantTycoon(commands.Cog):
damage_msg = "You used {} too many times!".format(product)
else:
damage_msg = "You gave too much of {}.".format(product)
message = "{} Your plant lost some health. :wilted_rose:".format(
damage_msg
)
message = "{} Your plant lost some health. :wilted_rose:".format(damage_msg)
gardener.points += self.defaults["points"]["add_health"]
await gardener.save_gardener()
elif product in gardener.products or product_category != "tool":
@ -440,9 +437,7 @@ class PlantTycoon(commands.Cog):
if not gardener.badges:
em.add_field(name="**Badges**", value="None")
else:
badges = "".join(
"{}\n".format(badge.capitalize()) for badge in gardener.badges
)
badges = "".join("{}\n".format(badge.capitalize()) for badge in gardener.badges)
em.add_field(name="**Badges**", value=badges)
if gardener.products:

@ -97,12 +97,7 @@ class ReactRestrict(Cog):
"""
current_combos = await self.combo_list()
to_keep = [
c
for c in current_combos
if c.message_id != message_id or c.role_id != role.id
]
to_keep = [c for c in current_combos if c.message_id != message_id or c.role_id != role.id]
if to_keep != current_combos:
await self.set_combo_list(to_keep)

Loading…
Cancel
Save