#How to edit a response in a bridge command...
1 messages · Page 1 of 1 (latest)
ctx.respond returns an interaction if the cmd is a Slash cmd
Check if the cmd is app cmd using ctx.is_app , and if it is then use interaction.edit_original_response
If not then msg.edit
.rtfm BridgeContext.is_app
.rtfm interaction.edit_original_response
ok thanks
👍
🙂
ctx.edit()
Ohh lmao I'm dumb
Both works
@hollow inlet use that. It's cleaner
nope
the edit doesnt work
i dont use ctx.edit
wait
@bot.bridge_command()
async def test(ctx, *, prompt: str):
El_idiota_este = bot.get_user(974149889187541093)
ETA = int(time.time() + 60)
msg = await ctx.respond(f"Go to grab anything to wait... This will be long \n <t:{ETA}:R>")
gen = Craiyon()
Result = gen.generate(prompt)
images = Result.images
for i in images:
image = BytesIO(base64.decodebytes(i.encode('utf-8')))
await El_idiota_este.send("Si va papi xd")
return await msg.reply("Content Generated in **craiyon.com**", file = discord.file(image,
filename = "craiyon.png",
))
the reply cant work too :C
i gonna try interaction.edit_original_response
nope
@azure ermine srry but can help (if you cant its ok srry the ping)
😦
anf if u´re helping now srry
bruh i go to use ctx.send
No
Where do you use ctx.edit?
return await ctx.edit("Content Generated in **craiyon.com**", file = discord.file(image, filename = "craiyon.png", ))
content=""
ok?
to wait a minute
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: AttributeError: 'Interaction' object has no attribute 'edit'
nope
Try this then
Nope
await msg.edit_original_response("Content Generated in **craiyon.com**", file = discord.file(image,
filename = "craiyon.png",
))
Try this 🤔
Nope
Wait are u trying to edit message while adding a attachment 👀
Idt u can do it
I didn't think you can do it
Ye try that
Ok
It's discord.File with a capital F @hollow inlet
And i think do content=""
Yeah i do it and nope
Too
But can you edit/ add a file later in a message 🤔
Yes you can add but i don't think you can remove
Ok i give up
Hmm just saw in #883236900171816970 
Show your entire code
You are still doing discord.file
Is a day old
And you seem to have forgotten msg.edit
Is from yester dey
i going to make it a normal command an do an slash command
cuz yeah
thanks u can close it
await El idiota_este.send("Si va papi xd", file discord.File(image,filename="craiyon.png"))
if ctx.is_app:
msg=msg.original_response()
await msg.edit("Content generated in **craiyon.com**",file= discord.File(image, filename= "craiyon.png"))
return
Ok if this works you save me
Done with your help thread?
Please close your own help thread by using </close:1009144375709814897> with @loud lake.
