Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#224)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/pre-commit/pre-commit-hooks: v4.5.0 → v4.6.0](pre-commit/pre-commit-hooks@v4.5.0...v4.6.0)
- [github.com/psf/black: 23.12.1 → 24.4.2](psf/black@23.12.1...24.4.2)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Jul 22, 2024
1 parent 116fa06 commit 00cc618
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 51 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ci:
autoupdate_schedule: quarterly
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
Expand All @@ -33,7 +33,7 @@ repos:
args: ['--in-place', '--remove-unused-variable']

- repo: https://github.com/psf/black
rev: '23.12.1'
rev: '24.4.2'
hooks:
- id: black
- repo: https://github.com/Pierre-Sassoulas/black-disable-checker
Expand Down
4 changes: 3 additions & 1 deletion crypto/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ async def get_header(

async def checkcoins(
self, base: str
) -> dict: # Attribution to TrustyJAID, https://github.com/TrustyJAID/Trusty-cogs/blob/ffdb8f77ed888d5bbbfcc3805d860e8dab80741b/conversions/conversions.py#L211
) -> (
dict
): # Attribution to TrustyJAID, https://github.com/TrustyJAID/Trusty-cogs/blob/ffdb8f77ed888d5bbbfcc3805d860e8dab80741b/conversions/conversions.py#L211
url = "https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest"
async with aiohttp.ClientSession() as session:
async with session.get(url, headers=await self.get_header()) as resp:
Expand Down
40 changes: 25 additions & 15 deletions dankmemer/dankmemer.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,11 @@ async def bed(self, ctx, user: discord.Member, user2: discord.Member = None):
ctx,
"/bed?avatar1={}{}".format(
user.display_avatar.replace(static_format="png").url,
f"&avatar2={user2.display_avatar.replace(static_format='png').url}"
if user2 is not None
else "",
(
f"&avatar2={user2.display_avatar.replace(static_format='png').url}"
if user2 is not None
else ""
),
),
)
if isinstance(data, dict):
Expand Down Expand Up @@ -863,9 +865,11 @@ async def madethis(self, ctx, user: discord.Member, user2: discord.Member = None
ctx,
"/madethis?avatar1={}{}".format(
user.display_avatar.replace(static_format="png").url,
f"&avatar2={user2.display_avatar.replace(static_format='png').url}"
if user2 is not None
else "",
(
f"&avatar2={user2.display_avatar.replace(static_format='png').url}"
if user2 is not None
else ""
),
),
)
if isinstance(data, dict):
Expand Down Expand Up @@ -1110,9 +1114,11 @@ async def screams(self, ctx, user: discord.Member, user2: discord.Member = None)
ctx,
"/screams?avatar1={}{}".format(
user.display_avatar.replace(static_format="png").url,
f"&avatar2={user2.display_avatar.replace(static_format='png').url}"
if user2 is not None
else "",
(
f"&avatar2={user2.display_avatar.replace(static_format='png').url}"
if user2 is not None
else ""
),
),
)
if isinstance(data, dict):
Expand Down Expand Up @@ -1153,9 +1159,11 @@ async def slap(self, ctx, user: discord.Member, user2: discord.Member = None):
ctx,
"/slap?avatar1={}{}".format(
user.display_avatar.replace(static_format="png").url,
f"&avatar2={user2.display_avatar.replace(static_format='png').url}"
if user2 is not None
else "",
(
f"&avatar2={user2.display_avatar.replace(static_format='png').url}"
if user2 is not None
else ""
),
),
)
if isinstance(data, dict):
Expand Down Expand Up @@ -1198,9 +1206,11 @@ async def spank(self, ctx, user: discord.Member, user2: discord.Member = None):
ctx,
"/spank?avatar1={}{}".format(
user.display_avatar.replace(static_format="png").url,
f"&avatar2={user2.display_avatar.replace(static_format='png').url}"
if user2 is not None
else "",
(
f"&avatar2={user2.display_avatar.replace(static_format='png').url}"
if user2 is not None
else ""
),
),
)
if isinstance(data, dict):
Expand Down
8 changes: 5 additions & 3 deletions giveaways/giveaways.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,11 @@ async def draw_winner(self, giveaway: Giveaway):
text=f"Reroll: {(await self.bot.get_prefix(msg))[-1]}gw reroll {giveaway.messageid}"
)
await channel_obj.send(
content="Congratulations " + ",".join([x.mention for x in winner_objs])
if winner_objs is not None
else "",
content=(
"Congratulations " + ",".join([x.mention for x in winner_objs])
if winner_objs is not None
else ""
),
embed=announce_embed,
)
if winner_objs is not None:
Expand Down
8 changes: 5 additions & 3 deletions redditpost/redditpost.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,9 +551,11 @@ async def format_send(self, data, channel, last_post, subreddit, settings):
try:
msg = await channel.send(
embed=emb,
view=Source(link)
if settings.get("source_button", True)
else None,
view=(
Source(link)
if settings.get("source_button", True)
else None
),
) # TODO: More approprriate error handling
if settings.get("publish", False):
try:
Expand Down
36 changes: 22 additions & 14 deletions simleague/simleague.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,20 +193,26 @@ async def _list(self, ctx, updatecache: bool = False, mobilefriendly: bool = Tru
embed.add_field(
name="Team {}".format(team),
value="{}**Members**:\n{}\n**Captain**: {}\n**Team Level**: ~{}{}{}".format(
"**Full Name**:\n{}\n".format(teams[team]["fullname"])
if teams[team]["fullname"] is not None
else "",
(
"**Full Name**:\n{}\n".format(teams[team]["fullname"])
if teams[team]["fullname"] is not None
else ""
),
"\n".join(mems),
list(teams[team]["captain"].values())[0],
lvl,
"\n**Role**: {}".format(
ctx.guild.get_role(teams[team]["role"]).mention
)
if teams[team]["role"] is not None
else "",
"\n**Stadium**: {}".format(teams[team]["stadium"])
if teams[team]["stadium"] is not None
else "",
(
"\n**Role**: {}".format(
ctx.guild.get_role(teams[team]["role"]).mention
)
if teams[team]["role"] is not None
else ""
),
(
"\n**Stadium**: {}".format(teams[team]["stadium"])
if teams[team]["stadium"] is not None
else ""
),
),
inline=True,
)
Expand Down Expand Up @@ -241,9 +247,11 @@ async def team(self, ctx, *, team: str):
embed = discord.Embed(
title="{} {}".format(
team,
"- {}".format(teams[team]["fullname"])
if teams[team]["fullname"] is not None
else "",
(
"- {}".format(teams[team]["fullname"])
if teams[team]["fullname"] is not None
else ""
),
),
colour=ctx.author.colour,
)
Expand Down
14 changes: 8 additions & 6 deletions unbelievaboat/roulette.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,14 @@ async def roulette_start(self, ctx):
NUMBERS[number],
number,
emoji,
box(
tabulate.tabulate(payouts, headers=["Bet", "Amount Won", "User"]),
lang="prolog",
)
if payouts
else "None.",
(
box(
tabulate.tabulate(payouts, headers=["Bet", "Amount Won", "User"]),
lang="prolog",
)
if payouts
else "None."
),
),
)
await msg.edit(embed=emb)
Expand Down
8 changes: 5 additions & 3 deletions unbelievaboat/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,11 @@ async def settings(self, ctx):
walletsettings = data["disable_wallet"]
embed.add_field(
name="Wallet Settings",
value="Disabled."
if not walletsettings
else f"**Max Balance**: {humanize_number(data['wallet_max'])}\n**Withdraw Cooldown**: {humanize_timedelta(seconds=cooldowns['withdrawcd'])}\n**Deposit Cooldown**: {humanize_timedelta(seconds=cooldowns['depositcd'])}",
value=(
"Disabled."
if not walletsettings
else f"**Max Balance**: {humanize_number(data['wallet_max'])}\n**Withdraw Cooldown**: {humanize_timedelta(seconds=cooldowns['withdrawcd'])}\n**Deposit Cooldown**: {humanize_timedelta(seconds=cooldowns['depositcd'])}"
),
inline=True,
)
minbet = humanize_number(data["betting"]["min"])
Expand Down
9 changes: 5 additions & 4 deletions userinfo/userinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,11 @@ async def userinfo(self, ctx, *, user: discord.Member = None):
else:
role_str = None
data = discord.Embed(
description=(status_string or activity)
+ f"\n\n{len(sharedguilds)} shared servers."
if len(sharedguilds) > 1
else f"\n\n{len(sharedguilds)} shared server.",
description=(
(status_string or activity) + f"\n\n{len(sharedguilds)} shared servers."
if len(sharedguilds) > 1
else f"\n\n{len(sharedguilds)} shared server."
),
colour=user.colour,
)

Expand Down

0 comments on commit 00cc618

Please sign in to comment.