add command to show nations not on refill list

This commit is contained in:
un1xx committed 2025-10-14 22:40:04 +05:30
1 parent 3b6b8d8f4a
commit 7b91a941ce
1 file changed
+21 -6
+21 -6
View File
@@ -1,3 +1,4 @@
from ast import alias
import asyncio import asyncio
import datetime import datetime
import io import io
@@ -336,7 +337,6 @@ class Banking(commands.Cog):
return interaction.user == ctx.author return interaction.user == ctx.author
async def callback(self, interaction: discord.Interaction): async def callback(self, interaction: discord.Interaction):
kit = pnwkit.QueryKit( kit = pnwkit.QueryKit(
api_key=os.getenv("pnwDILFKEY"), api_key=os.getenv("pnwDILFKEY"),
bot_key=os.getenv("pnwBOTKEY"), bot_key=os.getenv("pnwBOTKEY"),
@@ -624,7 +624,7 @@ class Banking(commands.Cog):
label="Resources", label="Resources",
style=discord.TextStyle.long, style=discord.TextStyle.long,
max_length=1024, max_length=1024,
placeholder=("money: 1000\n" "food: 1000\n" "... and so on"), placeholder=("money: 1000\nfood: 1000\n... and so on"),
required=True, required=True,
) )
@@ -733,7 +733,7 @@ class Banking(commands.Cog):
label="Resources", label="Resources",
style=discord.TextStyle.long, style=discord.TextStyle.long,
max_length=1024, max_length=1024,
placeholder=("money: 1000\n" "food: 1000\n" "... and so on"), placeholder=("money: 1000\nfood: 1000\n... and so on"),
required=True, required=True,
) )
@@ -911,6 +911,23 @@ class Banking(commands.Cog):
content += f"{i:>3}. {nation.id} {nation.nation_name}\n" content += f"{i:>3}. {nation.id} {nation.nation_name}\n"
await ctx.cbsend(content=content) await ctx.cbsend(content=content)
@commands.has_any_role("The Croak Council", "Government")
@commands.command(name="wcl!")
async def not_on_wclist(self, ctx: CustomCtx):
res = await self.kit.query(
"nations",
{"alliance_id": [10177, 10198], "alliance_position": [2, 3, 4, 5]},
"id, leader_name, nation_name",
)
i = 0
content = "Nations not in warchest refill list\n"
for nation in res.nations:
if nation.id in self.WARCHEST_IDS:
continue
i += 1
content += f"{i:>3}. {nation.id} {nation.nation_name}\n"
await ctx.cbsend(content)
@commands.has_any_role("The Croak Council", "Government") @commands.has_any_role("The Croak Council", "Government")
@commands.command(aliases=["wcr"]) @commands.command(aliases=["wcr"])
async def wcremove(self, ctx: commands.Context, ids: commands.Greedy[int]): async def wcremove(self, ctx: commands.Context, ids: commands.Greedy[int]):
@@ -1518,7 +1535,6 @@ class Banking(commands.Cog):
return interaction.user == ctx.author return interaction.user == ctx.author
async def callback(self, interaction: discord.Interaction): async def callback(self, interaction: discord.Interaction):
kit = pnwkit.QueryKit( kit = pnwkit.QueryKit(
api_key=os.getenv("pnwDILFKEY"), api_key=os.getenv("pnwDILFKEY"),
bot_key=os.getenv("pnwBOTKEY"), bot_key=os.getenv("pnwBOTKEY"),
@@ -1586,7 +1602,7 @@ class Banking(commands.Cog):
f"{Emojis.lead} {total.get('lead'):,}\n" f"{Emojis.lead} {total.get('lead'):,}\n"
f"{Emojis.iron} {total.get('iron'):,}\n" f"{Emojis.iron} {total.get('iron'):,}\n"
f"{Emojis.bauxite} {total.get('bauxite'):,}\n" f"{Emojis.bauxite} {total.get('bauxite'):,}\n"
) )
await ctx.send(embed=e) await ctx.send(embed=e)
paginator = ctx.Paginator(pages=embeds) paginator = ctx.Paginator(pages=embeds)
@@ -1594,7 +1610,6 @@ class Banking(commands.Cog):
ctx=ctx, custom_items=[ConfirmButton(bot=self.bot, p=paginator)] ctx=ctx, custom_items=[ConfirmButton(bot=self.bot, p=paginator)]
) )
@commands.command() @commands.command()
async def tf(self, ctx: CustomCtx, flags: TransferFlags): async def tf(self, ctx: CustomCtx, flags: TransferFlags):
""" """