Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CustomElement name when display = 'side' #1841

Open
lamylio opened this issue Jan 31, 2025 · 0 comments
Open

CustomElement name when display = 'side' #1841

lamylio opened this issue Jan 31, 2025 · 0 comments
Labels
enhancement New feature or request needs-triage

Comments

@lamylio
Copy link
Contributor

lamylio commented Jan 31, 2025

Hello,

My issue is that both the source and the replacement text for a CustomElement are defined by the property name, therefore I cannot use a CustomElement with display='side' and an arbitrary name. For example, if I want to have a CustomPDFElement.jsx that is displayed to the side that would replace the word 'source' from a Message(), this is currently impossible (AFAIK).

Describe the solution you'd like
I'd like to use another field, such as element, source, element_name on the constructor of CustomElement, and keep the behavior of the property name the same as all the built-in elements. ie, allowing this

await Message(
    content="Blabla, blaba.\n Click here to see the source",
    elements=[
        CustomElement(
            element="CustomPDFElement", # any other field name you'll consider better
            name="source",
            props={...},
            display = "side"
        )
    ],
).send()
@dosubot dosubot bot added the enhancement New feature or request label Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs-triage
Projects
None yet
Development

No branches or pull requests

1 participant