fix(sugoncredit): pylint fixes
This commit is contained in:
parent
a5cf3190d9
commit
3eb57fda4b
1 changed files with 4 additions and 7 deletions
|
@ -16,14 +16,14 @@ class SugonCredit(commands.Cog):
|
||||||
"""Checks an account's balance."""
|
"""Checks an account's balance."""
|
||||||
bank_name = await bank.get_bank_name(ctx.guild)
|
bank_name = await bank.get_bank_name(ctx.guild)
|
||||||
currency_name = await bank.get_currency_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)
|
bal = await bank.get_balance(ctx.author)
|
||||||
target = ctx.author
|
target = ctx.author
|
||||||
else:
|
else:
|
||||||
bal = await bank.get_balance(user)
|
bal = await bank.get_balance(user)
|
||||||
target = user
|
target = user
|
||||||
output_bal = (f'{bal:,}')
|
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}.")
|
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:
|
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.")
|
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:,}')
|
output_max_bal = (f'{max_bal:,}')
|
||||||
if new_bal > 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!")
|
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:
|
elif new_bal < 0:
|
||||||
await ctx.send(content=f"You are attempting to set {target.mention}'s balance to below 0. Please try again!")
|
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:
|
elif ctx.guild.id == 204965774618656769:
|
||||||
logging_channel: discord.TextChannel = self.bot.get_channel(1082495815878189076)
|
logging_channel: discord.TextChannel = self.bot.get_channel(1082495815878189076)
|
||||||
await bank.deposit_credits(target, amount=amount)
|
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}!")
|
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)
|
await target.send(content=f"You gained {output_amount} SugonCredit! Good work community member! You now have {output_new_bal} SugonCredits.", file=image)
|
||||||
else:
|
else:
|
||||||
await target.send(content=f"You gained {output_amount} SugonCredits! Good work community member! You now have {output_new_bal} SugonCredits.", file=image)
|
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:,}')
|
output_new_bal = (f'{new_bal:,}')
|
||||||
if new_bal < 0:
|
if new_bal < 0:
|
||||||
await ctx.send(content=f"You are attempting to set {target.mention}'s balance to below 0. Please try again!")
|
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:
|
elif ctx.guild.id == 204965774618656769:
|
||||||
await bank.withdraw_credits(target, amount=amount)
|
await bank.withdraw_credits(target, amount=amount)
|
||||||
logging_channel: discord.TextChannel = self.bot.get_channel(1082495815878189076)
|
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!")
|
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)
|
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:
|
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)
|
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)
|
||||||
|
|
Loading…
Reference in a new issue