update warchest cmd
This commit is contained in:
1 parent
dd21828d10
commit
565761ec38
1 file changed
+18
-8
+18
-8
@@ -1,4 +1,5 @@
|
||||
import datetime
|
||||
import io
|
||||
import os
|
||||
import random
|
||||
from typing import List, Literal, Optional
|
||||
@@ -152,20 +153,26 @@ class Banking(commands.Cog):
|
||||
alliance = data.alliances[0]
|
||||
nations = alliance.nations
|
||||
resource_delta = []
|
||||
|
||||
|
||||
for nation in nations:
|
||||
cities = len(nation.cities)
|
||||
delta = BaseMul.calc(cities, nation)
|
||||
delta.update({
|
||||
'id': nation.id,
|
||||
'discord': nation.discord or "None",
|
||||
'discord': nation.discord or "N/A",
|
||||
'cities': cities,
|
||||
'name': nation.nation_name
|
||||
})
|
||||
resource_delta.append(delta)
|
||||
count = 0
|
||||
buffer = io.StringIO()
|
||||
buffer.write(str(resource_delta))
|
||||
buffer.seek(0)
|
||||
await ctx.send(file=discord.File(fp=buffer, filename="rs.txt"))
|
||||
|
||||
embeds = []
|
||||
e = discord.Embed(title="Warchest Resources")
|
||||
count = 0
|
||||
|
||||
for rd in resource_delta:
|
||||
e.add_field(
|
||||
name=rd.get('name'),
|
||||
@@ -177,15 +184,18 @@ class Banking(commands.Cog):
|
||||
f"{Emojis.munitions} {rd.get('munitions'):,}\n"
|
||||
f"{Emojis.gasoline} {rd.get('gasoline'):,}\n"
|
||||
f"{Emojis.aluminum} {rd.get('aluminum'):,}\n"
|
||||
f"{Emojis.steel} {rd.get('steel'):,}"
|
||||
f"{Emojis.steel} {rd.get('steel100'):,}"
|
||||
)
|
||||
)
|
||||
count+=1
|
||||
count += 1
|
||||
if count == 9:
|
||||
count = 0
|
||||
e = discord.Embed(title="Warchest Resources")
|
||||
embeds.append(e)
|
||||
|
||||
e = discord.Embed(title="Warchest Resources")
|
||||
count = 0
|
||||
|
||||
if count > 0:
|
||||
embeds.append(e)
|
||||
|
||||
await ctx.paginate(embeds)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user