Is discord.ui.Modal supports button? #8312
-
I've tried, but it raises an error.
This is the minimum code. import discord
import discord.app_commands
import discord.ui
token = #TOKEN here
client = discord.Client(intents=discord.Intents.default())
tree = discord.app_commands.CommandTree(client)
@tree.command(
name="modal",
description="Send modal."
)
async def modal(ctx:discord.Interaction):
modal=discord.ui.Modal(title="Hello!")
modal.add_item(discord.ui.Button(label="Button"))
await ctx.response.send_modal(modal)
@client.event
async def on_ready():
print("ready")
await tree.sync()
client.run(token) How can I fix this? Or Is It not able? |
Beta Was this translation helpful? Give feedback.
Answered by
bijij
Aug 7, 2022
Replies: 2 comments 1 reply
-
Modals only support Select and TextInput components. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
beatbox4108
-
I forgot to close. sorry 🙏 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Modals only support Select and TextInput components.