discord-interactions.py

create_link_button

Function

Button that opens a URL. No event reaches the bot.

from discord_interactions import create_link_button

Signature

def create_link_button(    url: str,    label: str = '',    emoji: str | Dict[str, Any] | Any | None = None,    disabled: bool = False,) -> Dict[str, Any]

Parameters

NameTypeDefaultDescription
urlstrrequiredAddress opened on click (512 characters max).
labelstr''
emojistr | Dict[str, Any] | Any | NoneNone
disabledboolFalse

Returns

Dict[str, Any]

Example

from discord_interactions import create_action_row, create_link_button lien = create_link_button("https://discord.com/developers/docs", "Documentation Discord")await ctx.respond(components=[create_action_row(lien)])

Type a name: create_button, ModalBuilder, cooldown.