From 11558bf5585639af086728a7eaec4cffd99e61be Mon Sep 17 00:00:00 2001 From: un1xx Date: Tue, 3 Sep 2024 22:46:04 +0530 Subject: [PATCH] fix error in rss cmd --- exts/banking.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/exts/banking.py b/exts/banking.py index b649709..36cd6be 100644 --- a/exts/banking.py +++ b/exts/banking.py @@ -353,7 +353,7 @@ class Banking(commands.Cog): ) @commands.has_role(987770837627187250) @commands.command() - async def rss(self, ctx: CustomCtx, ids: commands.Greedy[int] = [], nation_names: commands.Greedy[str] = []): + async def rss(self, ctx: CustomCtx, ids: commands.Greedy[int] = [], *, nation_names: str|None =None): """get resources of a nation in alliance Args: @@ -368,13 +368,15 @@ class Banking(commands.Cog): aiohttp_session=aiohttp.ClientSession(loop=self.bot.loop), ) embeds = [] - for n in nation_names: - result = await self.kit.query( - "nations", - {"nation_name": n, "first": 1}, - "id" - ) - ids.append(result.nations[0].id) + if nation_names: + nation_names = nation_names.split(',') + 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: kit = self.kit if (id != 103764) else d_kit