update warchest cmd
This commit is contained in:
1 parent
dd21828d10
commit
565761ec38
1 file changed
+14
-4
+14
-4
@@ -1,4 +1,5 @@
|
|||||||
import datetime
|
import datetime
|
||||||
|
import io
|
||||||
import os
|
import os
|
||||||
import random
|
import random
|
||||||
from typing import List, Literal, Optional
|
from typing import List, Literal, Optional
|
||||||
@@ -158,14 +159,20 @@ class Banking(commands.Cog):
|
|||||||
delta = BaseMul.calc(cities, nation)
|
delta = BaseMul.calc(cities, nation)
|
||||||
delta.update({
|
delta.update({
|
||||||
'id': nation.id,
|
'id': nation.id,
|
||||||
'discord': nation.discord or "None",
|
'discord': nation.discord or "N/A",
|
||||||
'cities': cities,
|
'cities': cities,
|
||||||
'name': nation.nation_name
|
'name': nation.nation_name
|
||||||
})
|
})
|
||||||
resource_delta.append(delta)
|
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 = []
|
embeds = []
|
||||||
e = discord.Embed(title="Warchest Resources")
|
e = discord.Embed(title="Warchest Resources")
|
||||||
|
count = 0
|
||||||
|
|
||||||
for rd in resource_delta:
|
for rd in resource_delta:
|
||||||
e.add_field(
|
e.add_field(
|
||||||
name=rd.get('name'),
|
name=rd.get('name'),
|
||||||
@@ -177,13 +184,16 @@ class Banking(commands.Cog):
|
|||||||
f"{Emojis.munitions} {rd.get('munitions'):,}\n"
|
f"{Emojis.munitions} {rd.get('munitions'):,}\n"
|
||||||
f"{Emojis.gasoline} {rd.get('gasoline'):,}\n"
|
f"{Emojis.gasoline} {rd.get('gasoline'):,}\n"
|
||||||
f"{Emojis.aluminum} {rd.get('aluminum'):,}\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:
|
if count == 9:
|
||||||
count = 0
|
embeds.append(e)
|
||||||
e = discord.Embed(title="Warchest Resources")
|
e = discord.Embed(title="Warchest Resources")
|
||||||
|
count = 0
|
||||||
|
|
||||||
|
if count > 0:
|
||||||
embeds.append(e)
|
embeds.append(e)
|
||||||
|
|
||||||
await ctx.paginate(embeds)
|
await ctx.paginate(embeds)
|
||||||
|
|||||||
Reference in new issue
Block a user