#the claim button is not working? i do not receive any errors in my ide

55 messages · Page 1 of 1 (latest)

analog dove
#

this is a relatively simple code, but i cant seem to figure out why the claim button is not working, i keep receiving an error that says "this interaction has failed"

code: https://paste.pythondiscord.com/JRXA

clever urchin
#

Damn bro is building the bot I used to run

#

Check your console for details on the error log

analog dove
#

i see nothing :(

oak cobaltBOT
#

@analog dove

File Attachments Not Allowed

For safety reasons we do not allow files with certain file extensions.

Code Formatting

You can share your code using triple backticks like this:
```
YOUR CODE
```

Large Portions of Code

For longer scripts use Hastebin or GitHub Gists and share the link here

Ignored these files due to them having disallowed file extensions
  • 6miJZ8S.txt
clever urchin
#

Vencord renaming files is nasty fr

analog dove
#

LMAO

analog dove
#

it is running because the !vouch command works

#

and it sends the embed

#

but the button is the issue

clever urchin
#

Yes but Discord just shows you a generic "something went wrong" message

#

The bot console should tell us some more info

#

could also be an outdated client, not sure how that behaves with your modified Discord

analog dove
#

i tried it on my web browser

clever urchin
#

So we definitely know it's an issue with the bot

analog dove
#
class ClaimVouchView(View):
    def __init__(self, user: discord.User, reason: str):
        super().__init__()
        self.user = user
        self.reason = reason

    @discord.ui.button(label="Claim", style=discord.ButtonStyle.primary)
    async def claim_button(self, interaction: discord.Interaction, button: discord.ui.Button):
        if not is_staff(interaction.user):
            await interaction.response.send_message("You don't have permission to use this button.", ephemeral=True)
            return

        # Defer the response to avoid timing issues
        await interaction.response.defer()

        # Prepare the new view with Approve/Deny buttons
        new_view = HandleVouchView(user=self.user, reason=self.reason)

        # Edit the message to show that it's being handled by the claiming user
        await interaction.message.edit(content=f"This vouch is being handled by {interaction.user.mention}.",
                                       view=new_view)

        # Acknowledge the interaction with a follow-up
        await interaction.followup.send(f"You have claimed this vouch.", ephemeral=True)```
#

yup

#

its so frustrating

clever urchin
#

That looks ChatGPT for some reason

analog dove
#

i did ask chatgpt for help lmao

#

because i couldnt figure out the issue

#

and it gave me this shit

#

ive asked another friend of mine as well and he cant seeem to figure it out

#

ai is useless

#

gosh

clever urchin
#

Yes

#

I'd probably slap a try except around the entire thing and see if it throws somewhere in there

analog dove
#

alrighty let me try

clever urchin
#

Maybe the Discord bot library has some weird error handling behaviour that we might not be aware of

analog dove
#

but the code looks functional doesnt it

clever urchin
#

Looks correct

analog dove
#

i do not see anything

#

OHHHHHHH

clever urchin
#

Wrong import somewhere?

analog dove
#

possibly

#

im taking a closer look

#

this is odd

clever urchin
#

You don't necessarily need to interact with the button in the action I assume

analog dove
#

yaeh

#

but i dont understand why its not working

clever urchin
#

It should give you some sort of error at least

analog dove
#

doesnt work

#

i tried running it on pycharm as well

#

im just going to remove the claim button

#

dude i feel so dumb

#

i figured it out

#

god it was so fuc king stupid

#

LOOOL

clever urchin
#

What was it

analog dove
#

i had to enable some of the permissions on the developer portal sigh

#

you know the feeling you get when you fin ally make the code work