Skip to content

Commit

Permalink
maybe fix disconnects command
Browse files Browse the repository at this point in the history
  • Loading branch information
probablyjassin committed Dec 15, 2024
1 parent daa0389 commit f138389
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions cogs/profiles/disconnects.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,22 @@ async def disconnects_add(
str, name="player", description="username | @ mention | discord_id"
),
):
player: PlayerProfile = next(
(
p
for p in ctx.mogi.players
if p.discord_id == searched_player
or p.username.lower() == searched_player.lower()
),
None,
)
if not player:
player = search_player(searched_player)
player = search_player(searched_player)

if not player:
return await ctx.respond("Couldn't find that player")

if player in ctx.mogi.players:
player: PlayerProfile = next(
(
p
for p in ctx.mogi.players
if p.discord_id == searched_player
or p.name == searched_player.lower()
),
None,
)

player.add_disconnect()

await ctx.respond(
Expand Down

0 comments on commit f138389

Please sign in to comment.