I have tried to edit my code and here is the error I have now :
async def has_premium(self, guild):
if self.bot.premium_sku is None:
SKUS = await self.bot.fetch_skus()
for SKU in SKUS:
if SKU.name == "Unlock Premium Features":
self.bot.premium_sku = SKU
break
print([[entitlement.sku_id, entitlement.application_id] async for entitlement in guild.entitlements(limit=None, exclude_ended=True, skus=[self.bot.premium_sku])])
print(self.bot.premium_sku.id, self.bot.premium_sku.name)
return self.bot.premium_sku.id in [entitlement.sku_id async for entitlement in guild.entitlements(limit=None, exclude_ended=True, skus=[self.bot.premium_sku])]
I have this error thrown :
Ignoring exception in command premium status:
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/discord/commands/core.py", line 138, in wrapped
ret = await coro(arg)
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/discord/commands/core.py", line 1078, in _invoke
await self.callback(self.cog, ctx, **kwargs)
File "/app/cogs/premium/_config.py", line 52, in premium_status
has_premium = await self.has_premium(ctx.guild)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/cogs/premium/_config.py", line 41, in has_premium
print([entitlement async for entitlement in guild.entitlements(limit=None, skus=[self.bot.premium_sku])])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/discord/iterators.py", line 126, in __anext__
return await self.next()
^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/discord/iterators.py", line 1008, in next
await self.fill_entitlements()
File "/usr/local/lib/python3.12/site-packages/discord/iterators.py", line 1028, in fill_entitlements
data = await self._retrieve_entitlements(self.retrieve)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/discord/iterators.py", line 1048, in _retrieve_entitlements_before_strategy
data = await self.get_entitlements(
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/discord/http.py", line 2936, in list_entitlements
params["sku_ids"] = ",".join(sku_ids)
^^^^^^^^^^^^^^^^^
TypeError: sequence item 0: expected str instance, int found
Does anyone know why I have this ?