#Link Button
1 messages · Page 1 of 1 (latest)
I don't believe url buttons have a callback
you can't use them that way I think, since it's a link
Could you show the code where you send the button in the message?
Here's the link example.
yea true
also, link buttons cant be made with the decorator
"Verificate" lol
(verify / verified btw)
Here's the link example.
Mb
i already sent that
That why I said lb
Chat wasnt loaded completely
Also link button has no callback
class MyView(discord.ui.View):
def __init__(self):
super().__init__()
self.add_item(discord.ui.Button(label="Website", url="https://www.google.at/"))
@discord.ui.button(label="Verify", style=discord.ButtonStyle.success, emoji="✅")
async def button_callback(self, button, interaction):
await interaction.response.send_message("You got verificated!")
was also already said
Nope he said I believe, so I confirmed that
#1239200733329490031 message
without the query parameter tho
How can I know that a yeah is about that message when u didn’t even reply to it ?
Are you going to check every single of my message ?
right
luma, 2 people are already enough helping one person
we dont need 500 people in one post
Ur the one that make me send that much message, I just confirm 1 thing because I didn’t know ur message what about it
@gleaming temple
Url buttons don't have a callback, in short you can't know when they are pressed directly from discord. This is why your code was crashing. You can create url buttons in the view's initialization (__init__) which is ran every time the view is created. Here is what your code should look like
class MyView(discord.ui.View):
def __init__(self):
super().__init__()
self.add_item(discord.ui.Button(label="Website", url="https://www.google.at/")) # Link button
@discord.ui.button(label="Verify", style=discord.ButtonStyle.success, emoji="✅")
async def button_callback(self, button, interaction):
await interaction.response.send_message("You got verificated!")