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

Add support for buttons #26

Open
Rider21 opened this issue May 9, 2022 · 6 comments
Open

Add support for buttons #26

Rider21 opened this issue May 9, 2022 · 6 comments

Comments

@Rider21
Copy link

Rider21 commented May 9, 2022

I noticed that there is no support for button interactions
изображение

@Sopur
Copy link
Owner

Sopur commented May 12, 2022

Buttons are only possible for normal bots, not users.

@Sopur Sopur closed this as completed May 12, 2022
@Rider21
Copy link
Author

Rider21 commented May 13, 2022

I mean by pressing a button
rather than sending it in a message

@Sopur Sopur reopened this May 13, 2022
@Themis3000
Copy link

Seconded. I'd like to run e2e automated tests against a discord bot of mine, but part of what I have to test is interactions in a dm channel. Using a automated userbot to test to bot seems the only way to approach true e2e automated tests. It seems the only thing in the way of using this library for the purpose I want is support for interactions.

@Sopur
Copy link
Owner

Sopur commented Oct 8, 2022

I will look into it.

@Lizard-King101
Copy link

any update on this?

@CyberNinja2007
Copy link

CyberNinja2007 commented May 3, 2023

I managed to push the buttons as well as send the slash commands through the client.fetch_request(), if I understand it right, all the slash commands and buttons are interactions, so you need to go to the web version of Discord, open the network and send the slash command and you should see the post request that is sended to 'interactions' url and with that you can do client.fetch_request(). For buttons you need to get the message from bot through the client.on.message_create() and there you need to look at the components of this message, this components will be the buttons id. Next, you need to go to the browser again and click on some button and in the network tab you again will see the 'interactions' request. All you need to do is to send it like it was with the slash command through the client.fetch_request() For example:
const answer = await client.fetch_request( 'interactions', { method: 'POST', body: { <THE BODY OF THE REQUEST FROM WEB DISCORD> } }
Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants