update owner cmds

This commit is contained in:
un1xx committed 2025-05-11 17:07:18 +05:30
1 parent ca40b33099
commit 29ab3110e5
3 files changed
+22 -23

No files matched your search

+15 -2
View File
@@ -199,8 +199,21 @@ class Main(commands.Cog):
async def shell(self, ctx: commands.Context, *, cmd: codeblock_converter = None):
if cmd is None:
return
jskgit = bot.get_command("jsk sh")
await ctx.invoke(jskgit, argument=cmd)
jsksh = bot.get_command("jsk sh")
await ctx.invoke(jsksh, argument=cmd)
@commands.is_owner()
@commands.command(name="pullr")
async def pullr(self, ctx: CustomCtx):
"""
git pull and restart the bot.
"""
jskgit = bot.get_command("git")
await ctx.invoke(jskgit, argument="pull")
restart = bot.get_command("restart")
await ctx.invoke(restart)
@commands.command()
@commands.guild_only()
+7 -4
View File
@@ -180,7 +180,7 @@ class Banking(commands.Cog):
@commands.has_any_role("Government", "The Croak Council")
@commands.command(aliases=["wc"])
async def warchest(self, ctx: CustomCtx):
async def warchest(self, ctx: CustomCtx, ids: Optional[commands.Greedy[int]]=None):
"""
refill warchest of all members
"""
@@ -201,6 +201,8 @@ class Banking(commands.Cog):
)
gator = gator.nations[0]
nations.append(gator)
if ids:
nations = [n for n in nations if n.id in ids]
for nation in nations:
if nation.id not in self.WARCHEST_IDS:
@@ -261,9 +263,6 @@ class Banking(commands.Cog):
description="\u200b",
)
i = 0
for rd in resource_delta:
i += 1
e.description += f"{i}. [{rd.get('name')}](https://politicsandwar.com/nation/id={rd.get('id')})\n"
total = {
"money": 0,
"gasoline": 0,
@@ -275,6 +274,10 @@ class Banking(commands.Cog):
"steel40": 0,
}
for rd in resource_delta:
i += 1
e.description += f"{i}. [{rd.get('name')}](https://politicsandwar.com/nation/id={rd.get('id')})\n"
total["money"] += max(0, rd.get("money"))
total["steel100"] += max(0, rd.get("steel100"))
total["steel40"] += max(0, rd.get("steel40"))
-17
View File
@@ -1,17 +0,0 @@
import pnwkit
class Bank:
def __init__(self, kit: pnwkit.QueryKit):
self.kit = kit
async def balance(self, id: int):
"""
receiver_type:
()
"""
resources = await self.kit.query(
"alliances",
{"id": 10177, "first": 1},
"money, food, uranium, coal, iron, oil, bauxite, iron, lead, munitions, gasoline, aluminum, steel",
)