class ClanProfileCog(commands.Cog):
def __init__(self, bot: commands.Bot):
self.bot = bot
main_command = bot.get_slash_command("clan")
assert isinstance(main_command, commands.InvokableSlashCommand)
set_placeholder_parents(self, main_command)
@staticmethod
def group(data: list, group_size: int) -> list:
for i in range(0, len(data), group_size):
yield data[i:i + group_size]
class ProfileClanView(disnake.ui.View):
def __init__(self, inter, bot):
super().__init__(timeout=10)
self.inter = inter
self.bot = bot
# ...
async def on_timeout(self):
try:
message = self.bot.get_message(await self.inter.original_message().id)
for item in message.children:
item.disabled = True
await self.inter.edit_original_message(view=self)
return await super().on_timeout()
except disnake.NotFound:
pass```
```py
@command_placeholder(commands.SubCommand, name="profile", description = "...")
async def clan_profile(self, inter : disnake.ApplicationCommandInteraction):
# ...
await inter.send(inter.author.mention, embed=embed, view=ProfileClanView(inter, self.bot))
ERROR: https://paste.disnake.dev/?id=1699796082067101&language=python