🧹 PEP updating
This commit is contained in:
@ -42,7 +42,7 @@ class Invest():
|
||||
price: int
|
||||
The price of the stock.
|
||||
"""
|
||||
res = self.bot.finnhubClient.quote(symbol.upper())
|
||||
res = self.bot.finnhub_client.quote(symbol.upper())
|
||||
if res == {}:
|
||||
return 0
|
||||
else:
|
||||
@ -65,7 +65,7 @@ class Invest():
|
||||
investmentsDatabase = self.bot.database["investments"]
|
||||
userInvestments = investmentsDatabase.find_one({"_id": user})
|
||||
|
||||
userName = self.bot.databaseFuncs.getName(user)
|
||||
userName = self.bot.database_funcs.getName(user)
|
||||
|
||||
if userInvestments in [None, {}]:
|
||||
return f"{userName} does not have a stock portfolio."
|
||||
@ -162,7 +162,7 @@ class Invest():
|
||||
}
|
||||
investmentsDatabase.insert_one(newUser)
|
||||
|
||||
userName = self.bot.databaseFuncs.getName(user)
|
||||
userName = self.bot.database_funcs.getName(user)
|
||||
sendMessage = "{} bought {} GwendoBucks worth of {} stock"
|
||||
sendMessage = sendMessage.format(userName, buyAmount, stock)
|
||||
return sendMessage
|
||||
@ -219,7 +219,7 @@ class Invest():
|
||||
updater = {"$unset": {f"investments.{stock}": ""}}
|
||||
investmentsDatabase.update_one({"_id": user}, updater)
|
||||
|
||||
userName = self.bot.databaseFuncs.getName(user)
|
||||
userName = self.bot.database_funcs.getName(user)
|
||||
sendMessage = "{} sold {} GwendoBucks worth of {} stock"
|
||||
return sendMessage.format(userName, sellAmount, stock)
|
||||
else:
|
||||
@ -252,7 +252,7 @@ class Invest():
|
||||
response = response.format(commands[0].upper())
|
||||
else:
|
||||
price = f"{price:,}".replace(",", ".")
|
||||
response = self.bot.longStrings["Stock value"]
|
||||
response = self.bot.long_strings["Stock value"]
|
||||
response = response.format(commands[1].upper(), price)
|
||||
|
||||
elif parameters.startswith("buy"):
|
||||
@ -260,14 +260,14 @@ class Invest():
|
||||
if len(commands) == 3:
|
||||
response = self.buyStock(user, commands[1], int(commands[2]))
|
||||
else:
|
||||
response = self.bot.longStrings["Stock parameters"]
|
||||
response = self.bot.long_strings["Stock parameters"]
|
||||
|
||||
elif parameters.startswith("sell"):
|
||||
commands = parameters.split(" ")
|
||||
if len(commands) == 3:
|
||||
response = self.sellStock(user, commands[1], int(commands[2]))
|
||||
else:
|
||||
response = self.bot.longStrings["Stock parameters"]
|
||||
response = self.bot.long_strings["Stock parameters"]
|
||||
|
||||
else:
|
||||
response = "Incorrect parameters"
|
||||
@ -280,7 +280,7 @@ class Invest():
|
||||
"description": text,
|
||||
"colour": 0x00FF00
|
||||
}
|
||||
em = discord.Embed(*embedParams)
|
||||
em = discord.Embed(**embedParams)
|
||||
await ctx.send(embed=em)
|
||||
else:
|
||||
await ctx.send(response)
|
||||
|
Reference in New Issue
Block a user