From 3eb57fda4b9c4d94619a58047c153263e6e9b94e Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Sun, 24 Sep 2023 20:50:38 -0400 Subject: [PATCH] fix(sugoncredit): pylint fixes --- sugoncredit/sugoncredit.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/sugoncredit/sugoncredit.py b/sugoncredit/sugoncredit.py index 43c264c..46f3e56 100644 --- a/sugoncredit/sugoncredit.py +++ b/sugoncredit/sugoncredit.py @@ -16,14 +16,14 @@ class SugonCredit(commands.Cog): """Checks an account's balance.""" bank_name = await bank.get_bank_name(ctx.guild) currency_name = await bank.get_currency_name(ctx.guild) - if user == None: + if user is None: bal = await bank.get_balance(ctx.author) target = ctx.author else: bal = await bank.get_balance(user) target = user output_bal = (f'{bal:,}') - if bal == 1 or bal == -1: + if bal in (1, -1): embed=discord.Embed(title=f"{bank_name} - Balance", color=await self.bot.get_embed_color(None), description=f"{target.mention} has {output_bal} {currency_name}.") else: embed=discord.Embed(title=f"{bank_name} - Balance", color=await self.bot.get_embed_color(None), description=f"{target.mention} has {output_bal} {currency_name}s.") @@ -49,15 +49,13 @@ class SugonCredit(commands.Cog): output_max_bal = (f'{max_bal:,}') if new_bal > max_bal: await ctx.send(content=f"You are attempting to set {target.mention}'s balance to above {output_max_bal}. Please try again!") - return elif new_bal < 0: await ctx.send(content=f"You are attempting to set {target.mention}'s balance to below 0. Please try again!") - return elif ctx.guild.id == 204965774618656769: logging_channel: discord.TextChannel = self.bot.get_channel(1082495815878189076) await bank.deposit_credits(target, amount=amount) await ctx.send(content=f"{target.mention} now has {output_amount} more SugonCredit, with a total of {output_new_bal}!") - if amount == 1 or amount == -1: + if amount in (1, -1): await target.send(content=f"You gained {output_amount} SugonCredit! Good work community member! You now have {output_new_bal} SugonCredits.", file=image) else: await target.send(content=f"You gained {output_amount} SugonCredits! Good work community member! You now have {output_new_bal} SugonCredits.", file=image) @@ -86,12 +84,11 @@ class SugonCredit(commands.Cog): output_new_bal = (f'{new_bal:,}') if new_bal < 0: await ctx.send(content=f"You are attempting to set {target.mention}'s balance to below 0. Please try again!") - return elif ctx.guild.id == 204965774618656769: await bank.withdraw_credits(target, amount=amount) logging_channel: discord.TextChannel = self.bot.get_channel(1082495815878189076) await ctx.send(content=f"{target.mention} now has {output_amount} less SugonCredit, with a total of {output_new_bal}!\nIf this is a punishment, do better Galaxy Player! Re-education mods will be sent to your DM's if your SugonCredit drops to a substantially low amount!") - if amount == 1 or amount == -1: + if amount in (1, -1): await target.send(content=f"__MESSAGE FROM THE MINISTRY OF THE MEGA BASE__\n\n(我们的) {output_amount} SugonCredit has been taken from your account. Citizen, do not continue to preform bad actions! Glory to the Galaxy Communist Party!", file=image) else: await target.send(content=f"__MESSAGE FROM THE MINISTRY OF THE MEGA BASE__\n\n(我们的) {output_amount} SugonCredits have been taken from your account. Citizen, do not continue to preform bad actions! Glory to the Galaxy Communist Party!", file=image)