update rss cmd to use nation names
This commit is contained in:
1 parent
660dd7bea0
commit
8c9f197544
2 files changed
+13
-3
No files matched your search
+12
-3
@@ -353,7 +353,7 @@ class Banking(commands.Cog):
|
|||||||
)
|
)
|
||||||
@commands.has_role(987770837627187250)
|
@commands.has_role(987770837627187250)
|
||||||
@commands.command()
|
@commands.command()
|
||||||
async def rss(self, ctx: CustomCtx, ids: commands.Greedy[int] = []):
|
async def rss(self, ctx: CustomCtx, ids: commands.Greedy[int] = [], nation_names: commands.Greedy[str] = []):
|
||||||
"""get resources of a nation in alliance
|
"""get resources of a nation in alliance
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@@ -368,12 +368,20 @@ class Banking(commands.Cog):
|
|||||||
aiohttp_session=aiohttp.ClientSession(loop=self.bot.loop),
|
aiohttp_session=aiohttp.ClientSession(loop=self.bot.loop),
|
||||||
)
|
)
|
||||||
embeds = []
|
embeds = []
|
||||||
|
for n in nation_names:
|
||||||
|
result = await self.kit.query(
|
||||||
|
"nations",
|
||||||
|
{"nation_name": n, "first": 1},
|
||||||
|
"id"
|
||||||
|
)
|
||||||
|
ids.append(result.nations[0].id)
|
||||||
|
|
||||||
for id in ids:
|
for id in ids:
|
||||||
kit = self.kit if (id != 103764) else d_kit
|
kit = self.kit if (id != 103764) else d_kit
|
||||||
nation = await kit.query(
|
nation = await kit.query(
|
||||||
"nations",
|
"nations",
|
||||||
{"id": id, "first": 1},
|
{"id": id, "first": 1},
|
||||||
"id, nation_name, discord,money, flag, food, uranium, coal, iron, oil, bauxite, iron, lead, munitions, gasoline, aluminum, steel, num_cities",
|
"id, nation_name, discord,money, flag, food, uranium, coal, iron, oil, bauxite, iron, lead, munitions, gasoline, aluminum, steel, num_cities, credits",
|
||||||
)
|
)
|
||||||
nation = nation.nations[0]
|
nation = nation.nations[0]
|
||||||
e = discord.Embed(
|
e = discord.Embed(
|
||||||
@@ -395,7 +403,8 @@ class Banking(commands.Cog):
|
|||||||
f"{Emojis.munitions} {nation.munitions:,}\n"
|
f"{Emojis.munitions} {nation.munitions:,}\n"
|
||||||
f"{Emojis.gasoline} {nation.gasoline:,}\n"
|
f"{Emojis.gasoline} {nation.gasoline:,}\n"
|
||||||
f"{Emojis.aluminum} {nation.aluminum:,}\n"
|
f"{Emojis.aluminum} {nation.aluminum:,}\n"
|
||||||
f"{Emojis.steel} {nation.steel:,}"
|
f"{Emojis.steel} {nation.steel:,}\n"
|
||||||
|
f"{Emojis.credits} {nation.credits}\n"
|
||||||
)
|
)
|
||||||
embeds.append(e)
|
embeds.append(e)
|
||||||
|
|
||||||
|
|||||||
@@ -14,3 +14,4 @@ class Emojis:
|
|||||||
oil = "<:oil:1220371873267843143>"
|
oil = "<:oil:1220371873267843143>"
|
||||||
coal = "<:coal:1220371877013229619>"
|
coal = "<:coal:1220371877013229619>"
|
||||||
money = "<:dollarsym:1220378339970252841>"
|
money = "<:dollarsym:1220378339970252841>"
|
||||||
|
credits = "<:credits:1280569595366867066>"
|
||||||
Reference in new issue
Block a user