Skip to content

How to send an Components? (Buttons) | Edit: We can use Webhooks or Bots. #8

Answered by rigwild
DeadLyBro asked this question in Q&A
Discussion options

You must be logged in to vote

According to the documentation, this should work, but it doesn't send a button (only the message). Maybe user accounts cannot send it? I don't know!

Anyway, we wouldn't be able to listen to the events/webhooks so this is not that useful for this lib!

msg = {
    "content": "This is a message with components",
    "components": [
        {
            "type": 1,
            "components": [
                {
                    "type": 2,
                    "label": "Click me!",
                    "style": 1,
                    "custom_id": "click_one"
                }
            ]

        }
    ]
}

await api.apiCall(`/channels/${cid}/messages`, msg, 'POST')

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@DeadLyBro
Comment options

@bariscodefxy
Comment options

@bariscodefxy
Comment options

@bariscodefxy
Comment options

Answer selected by DeadLyBro
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
wontfix This will not be worked on
3 participants