mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-22 02:37:57 -05:00
Bump black to 20.8b1 (and reformat) (#4371)
* Bump black version * Reformat with black
This commit is contained in:
@@ -314,7 +314,8 @@ class Warnings(commands.Cog):
|
||||
for r, v in registered_reasons.items():
|
||||
if await ctx.embed_requested():
|
||||
em = discord.Embed(
|
||||
title=_("Reason: {name}").format(name=r), description=v["description"],
|
||||
title=_("Reason: {name}").format(name=r),
|
||||
description=v["description"],
|
||||
)
|
||||
em.add_field(name=_("Points"), value=str(v["points"]))
|
||||
msg_list.append(em)
|
||||
@@ -343,7 +344,9 @@ class Warnings(commands.Cog):
|
||||
em = discord.Embed(title=_("Action: {name}").format(name=r["action_name"]))
|
||||
em.add_field(name=_("Points"), value="{}".format(r["points"]), inline=False)
|
||||
em.add_field(
|
||||
name=_("Exceed command"), value=r["exceed_command"], inline=False,
|
||||
name=_("Exceed command"),
|
||||
value=r["exceed_command"],
|
||||
inline=False,
|
||||
)
|
||||
em.add_field(name=_("Drop command"), value=r["drop_command"], inline=False)
|
||||
msg_list.append(em)
|
||||
@@ -436,7 +439,10 @@ class Warnings(commands.Cog):
|
||||
title = _("Warning from {user}").format(user=ctx.author)
|
||||
else:
|
||||
title = _("Warning")
|
||||
em = discord.Embed(title=title, description=reason_type["description"],)
|
||||
em = discord.Embed(
|
||||
title=title,
|
||||
description=reason_type["description"],
|
||||
)
|
||||
em.add_field(name=_("Points"), value=str(reason_type["points"]))
|
||||
try:
|
||||
await user.send(
|
||||
@@ -462,14 +468,18 @@ class Warnings(commands.Cog):
|
||||
title = _("Warning from {user}").format(user=ctx.author)
|
||||
else:
|
||||
title = _("Warning")
|
||||
em = discord.Embed(title=title, description=reason_type["description"],)
|
||||
em = discord.Embed(
|
||||
title=title,
|
||||
description=reason_type["description"],
|
||||
)
|
||||
em.add_field(name=_("Points"), value=str(reason_type["points"]))
|
||||
warn_channel = self.bot.get_channel(guild_settings["warn_channel"])
|
||||
if warn_channel:
|
||||
if warn_channel.permissions_for(guild.me).send_messages:
|
||||
with contextlib.suppress(discord.HTTPException):
|
||||
await warn_channel.send(
|
||||
_("{user} has been warned.").format(user=user.mention), embed=em,
|
||||
_("{user} has been warned.").format(user=user.mention),
|
||||
embed=em,
|
||||
)
|
||||
|
||||
if not dm_failed:
|
||||
|
||||
Reference in New Issue
Block a user