#I tried to open the modal from the button, but it didn't work.Finally, I want to send it to another

1 messages · Page 1 of 1 (latest)

lavish thistle
#

The code below has been added.
`import discord
from discord import Option
import os
from dotenv import load_dotenv
from discord.ext import commands

intents = discord.Intents.default()
bot = commands.Bot(command_prefix='!', intents=intents)`

hearty whale
#

For everyone's sake here: use a codeblock

#

And you're not saying how it's not working

#

Nor provided any errors

lavish thistle
#

There is no error.

hearty whale
#

And use a codeblock for the code

#

Literally can't read anything like that

lavish thistle
#

Is there an error in this code? Even if I press the button that came out with the slash command, the modal won't open😭

hearty whale
#
  1. ctx.interaction.response can just be ctx.respond
  2. your modal callback makes no sense, you must respond
  3. you're not even subclassing a modal view
  4. you're not even sending the modal on the button view
  5. your button won't even work cause there's no callback assigned to it
#

TL;DR: your code is a mess, nothing works. You subclassed wrong stuff and didn't even do it right.

hearty whale
lavish thistle
#

Please tell me, teacher.

hearty whale
#

No I won't 👍🏽

#

Use the guides and examples

#

I won't fix your code. Which is rewriting most of it

naive nestBOT
#

Here's the confirm example.

#

Here's the modal dialogs example.

naive nestBOT
#

This thread was archived by the user that opened it.