#unknown message

1 messages · Page 1 of 1 (latest)

torn frost
#

help in the pic is my code

sweet dune
#

likely purge is taking a long time

torn frost
#

wdym

sweet dune
#

Right.

#

So you're acknowledging the interaction with the defer. The bot only has access to the interaction for 15 minutes.

#

so, if purge takes a long time, the edit coming after no longer has access to the interaction, it no longer exists.

torn frost
#

even if i purge 2 messages it will make an error

#

btw im using a button to trigger the purge

sweet dune
#

this is in a button callback?

torn frost
torn frost
sweet dune
#

hmm

torn frost
#

maybe the bot doesnt have a command triggered to respond to

sweet dune
#

A button is an interaction

torn frost
#

oh so its like a command

sweet dune
#

so it would be responding to that interaction

torn frost
#

ok

#

hmmm

sweet dune
#

Not sure what's happening, then.

torn frost
#

maybe because when deleting the channel it even deletes the response of the bot

sweet dune
#

Well, yes.

torn frost
#

so its that

#

how can i fix that if there is a possibility to fix it

sweet dune
#

don't use the command in the channel you're wanting to destroy

torn frost
#

ooh

#

so i'll have to make another option in the command to tell what channel should i destroy

#

how can i pass the channel i send from the command to the listener?

sweet dune
#

pass the ID as part of the custom_id

#

then get the channel from cache

torn frost
#

sorry i don't understand

sweet dune
#

when you create the button, pass the ID of the target channel in the custom_id for the button

torn frost
#

ooh

#

ok

#

i will try

sweet dune
#

show code

tame parcel
#

what I think is happening is that the purge is deleting the defer message

#

therefore it can't be edited

unborn ginkgo
#

can you pass None to limit?

sweet dune
#

You can.

unborn ginkgo
#

It will just default to the 100 then?

sweet dune
#

No.

#

It will just to into single delete mode after 100 or for messages older than 14 days.

#

So it just takes a lot longer

unborn ginkgo
#

Looking at the source it looks like if you use the around stategy with limit == none it wil error out, otherwise if limit == None or limit > 100 it will just be set to 100, and the _single_delete_strategy won't be invoked before it hits a message older than 14 days.

#

unless you set bulk = False

unborn ginkgo
torn frost