#How to edit a response in a bridge command...

1 messages · Page 1 of 1 (latest)

hollow inlet
#

I want edit a message but i use the bridge decorator :C

stark tinsel
#

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

scarlet steppeBOT
stark tinsel
#

.rtfm interaction.edit_original_response

scarlet steppeBOT
hollow inlet
#

ok thanks

stark tinsel
#

👍

hollow inlet
#

🙂

azure ermine
#

ctx.edit()

stark tinsel
#

Ohh lmao I'm dumb

azure ermine
#

Both works

stark tinsel
hollow inlet
#

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

azure ermine
#

No

hollow inlet
#

and prove luck

#

ok

azure ermine
#

Where do you use ctx.edit?

hollow inlet
#

return await ctx.edit("Content Generated in **craiyon.com**", file = discord.file(image, filename = "craiyon.png", ))

azure ermine
#

content=""

hollow inlet
#

ok?

#

to wait a minute

#

discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: AttributeError: 'Interaction' object has no attribute 'edit'

#

nope

stark tinsel
hollow inlet
#

Nope

tranquil verge
hollow inlet
#

Ok

#

Wait cuz im out of home

hollow inlet
#

Nope

tranquil verge
#

Wait are u trying to edit message while adding a attachment 👀

hollow inlet
#

Yes

#

Why?

tranquil verge
#

Idt u can do it

hollow inlet
#

?

#

I speak spanish what that means

tranquil verge
#

I didn't think you can do it

hollow inlet
#

New Expression Learned

#

Ok

#

I send the attachment in a other msg or...

tranquil verge
#

Ye try that

hollow inlet
#

Ok

stark tinsel
#

And i think do content=""

hollow inlet
hollow inlet
tranquil verge
hollow inlet
#

A

#

Anyway if i dont can do it i make a slash and prefix command separate

stark tinsel
hollow inlet
#

Ok i give up

tranquil verge
stark tinsel
hollow inlet
#

Thanks for help

#

Ok wait

tranquil verge
#

And put in code block

hollow inlet
stark tinsel
#

You are still doing discord.file

hollow inlet
#

Is a day old

stark tinsel
#

And you seem to have forgotten msg.edit

hollow inlet
#

Is from yester dey

stark tinsel
#

Ok

hollow inlet
#

i going to make it a normal command an do an slash command

#

cuz yeah

#

thanks u can close it

tranquil verge
#
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
hollow inlet
#

Ok if this works you save me

tranquil verge
#

Check for indents though I typed in mobile heh

#

If you get error put that to here

hollow inlet
#

srry i get sleep

#

i´m a dumb now

hollow inlet
#

yeah it works...

#

so thanks

tranquil verge
#

Noice

#

.close

scarlet steppeBOT
#

Done with your help thread?

Please close your own help thread by using </close:1009144375709814897> with @loud lake.