fix error

This commit is contained in:
un1xx committed 2025-05-09 19:31:47 +05:30
1 parent e2c37d972e
commit 90740244d3
1 file changed
+8 -7
+8 -7
View File
@@ -12,6 +12,7 @@ import discord
import asyncpg import asyncpg
import pnwkit import pnwkit
from discord.ext import commands from discord.ext import commands
from discord import app_commands
from discord.utils import format_dt from discord.utils import format_dt
from numerize_denumerize import denumerize, numerize from numerize_denumerize import denumerize, numerize
@@ -74,23 +75,23 @@ class Banking(commands.Cog):
bot_key_api_key=os.getenv("pnwACCKEY"), bot_key_api_key=os.getenv("pnwACCKEY"),
aiohttp_session=aiohttp.ClientSession(loop=self.bot.loop), aiohttp_session=aiohttp.ClientSession(loop=self.bot.loop),
) )
self.FILL = None self.WARCHEST_IDS = None
async def cog_load(self): async def cog_load(self):
"""Called when the cog is loaded.""" """Called when the cog is loaded."""
await self.fetch_refill_ids() await self.fetch_warchest_ids()
async def fetch_refill_ids(self): async def fetch_warchest_ids(self):
"""Fetch nation IDs from the refill table.""" """Fetch nation IDs from the warchest table."""
try: try:
async with self.bot.db_pool.acquire() as conn: async with self.bot.db_pool.acquire() as conn:
query = "SELECT id FROM refill" query = "SELECT id FROM warchest"
rows = await conn.fetch(query) rows = await conn.fetch(query)
self.FILL = [row[0] for row in rows] self.FILL = [row[0] for row in rows]
except Exception as e: except Exception as e:
self.FILL = [] self.WARCHEST_IDS = []
@commands.has_any_role("Government", "The Croak Council") @commands.has_any_role("Government", "The Croak Council")
@commands.command() @commands.command()
@@ -200,7 +201,7 @@ class Banking(commands.Cog):
nations.append(gator) nations.append(gator)
for nation in nations: for nation in nations:
if nation.id not in self.FILL: if nation.id not in self.WARCHEST_IDS:
continue continue
cities = len(nation.cities) cities = len(nation.cities)
delta = BaseMul.calc(cities, nation) delta = BaseMul.calc(cities, nation)