#🔒 When I press the button nothing happens

26 messages · Page 1 of 1 (latest)

shy dew
#
class AcceptButton(discord.ui.View):
    def __init__(self):
        super().__init__()

    @discord.ui.button(label="Откликнутся!", style=discord.ButtonStyle.green)
    async def embed_button(self, interaction: discord.Interaction):
        print("Button has pressed")
snow turtleBOT
#

@shy dew

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

shy dew
#

Error

TypeError: AcceptButton.embed_button() takes 2 positional arguments but 3 were given
rapid hemlock
#

where ur calling ur embed_button method ur passing 3 arguments instead of only 2

blazing plank
shy dew
#

In channel.send()

rapid hemlock
#

wherever you "use" it, you're passing 3 arguments which is causing the error

shy dew
rapid hemlock
#

can you send the view function assuming you wrote it

#

wait nvm

#

ah i see

#

eagle mentioned the problem i skipped over it

#

you need to add another parameter to the embed_button method

shy dew
rapid hemlock
#

yes

#

you dont need to do anything with it

#

you just need to have 1 more

shy dew
#

Yes! Its works!

rapid hemlock
#

nice

shy dew
#

Thanks

#

!clos

snow turtleBOT
#
Did you mean:

!close

shy dew
#

!close

snow turtleBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.