gpt-4-0314· OpenAI
WildChat-4.8M (AI2)
How to add ui.View to discord interaction and on button click change message?
- User
How to add ui.View to discord interaction and on button click change message?
- Assistant
Discord doesn't have native support for
ui.Viewas it's not a web-based platform. However, you can achieve similar functionality using Discord's built-in components like buttons and message interactions. Here's an example of how you can create a message with a button and handle the button click to change the message using discord.py:- First, make sure you have discord.py 2.0.0 or newer.
bashpip install discord.py>=2.0.0- Create a simple bot script with a slash command that sends a message with a button.