iamkubi / pydactyl

Python wrapper for the Pterodactyl Panel API
MIT License
69 stars 21 forks source link

Everything else works when i try to make it, but delete user does not work #88

Closed Poseidon281 closed 6 months ago

Poseidon281 commented 6 months ago

Describe the bug There is an error when i try to delete a user from my panel

To Reproduce Steps to reproduce the behavior. Please make sure to include sample code that will reproduce your issue. If applicable include the full traceback, not just a single line error message. Code:

    class Modal_Delete_User(discord.ui.Modal):
        def __init__(self, *args, **kwargs) -> None:
            super().__init__(*args, **kwargs)

            self.add_item(discord.ui.InputText(label="User-ID", required=True))

        async def callback(self, interaction: discord.Interaction):
            try:
                user = self.children[0].value
                api.user.delete_user(user_id=user, external_id=None, detail=False)
                embed = discord.Embed(title=f"Result: User with UserID: {user} was Deleted")
                await interaction.response.send_message(embeds=[embed])

            except Exception as e:
                embed = discord.Embed(title="Result: A error occured while trying to delete user")
                embed.add_field(name="Error", value=str(e))
                await interaction.response.send_message(embeds=[embed])

Expected behavior A clear and concise description of what you expected to happen.

Environment

Additional context Add any other context about the problem here.

iamkubi commented 6 months ago

I can only assume you're asking me to fix your AI generated code. Please stop filing issues just because your generated code doesn't work.

Poseidon281 commented 6 months ago

I can only assume you're asking me to fix your AI generated code. Please stop filing issues just because your generated code doesn't work.

This code is not AI generated. I followed the docs precisely and it does not work. So that is why I made a issue.

iamkubi commented 6 months ago

Yes, whatever the reason the code you're pasting clearly exceeds your skill level. You need to understand the data types of objects you're working with. This isn't an issue with the library.