update refill cmd
This commit is contained in:
1 parent
708bffde8f
commit
2efd6161ad
1 file changed
+6
-9
+6
-9
@@ -1380,8 +1380,6 @@ class Banking(commands.Cog):
|
|||||||
@commands.command()
|
@commands.command()
|
||||||
async def refill(self, ctx: CustomCtx, ids: commands.Greedy[int]):
|
async def refill(self, ctx: CustomCtx, ids: commands.Greedy[int]):
|
||||||
revenue_data = await self.get_alliance_rev(ids)
|
revenue_data = await self.get_alliance_rev(ids)
|
||||||
await ctx.cbsend(revenue_data[0])
|
|
||||||
|
|
||||||
def calc_tosend(raw: float, on_nation: float):
|
def calc_tosend(raw: float, on_nation: float):
|
||||||
return int(7 * abs(raw) - on_nation)
|
return int(7 * abs(raw) - on_nation)
|
||||||
|
|
||||||
@@ -1401,15 +1399,14 @@ class Banking(commands.Cog):
|
|||||||
count = 0
|
count = 0
|
||||||
|
|
||||||
for data in revenue_data:
|
for data in revenue_data:
|
||||||
oil = data.get("oil")
|
revenue = data.get("revenue")
|
||||||
coal = data.get("coal")
|
oil = revenue.get("oil")
|
||||||
lead = data.get("lead")
|
coal = revenue.get("coal")
|
||||||
iron = data.get("iron")
|
lead = revenue.get("lead")
|
||||||
bauxite = data.get("bauxite")
|
iron = revenue.get("iron")
|
||||||
|
bauxite = revenue.get("bauxite")
|
||||||
data["refill"] = dict()
|
data["refill"] = dict()
|
||||||
text = ""
|
text = ""
|
||||||
if oil is None:
|
|
||||||
await ctx.send(data)
|
|
||||||
if oil < 0:
|
if oil < 0:
|
||||||
tosend = calc_tosend(oil, data.get("nation_oil"))
|
tosend = calc_tosend(oil, data.get("nation_oil"))
|
||||||
data["refill"].update(oil=tosend)
|
data["refill"].update(oil=tosend)
|
||||||
|
|||||||
Reference in new issue
Block a user