#unknown message
1 messages · Page 1 of 1 (latest)
likely purge is taking a long time
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.
even if i purge 2 messages it will make an error
btw im using a button to trigger the purge
this is in a button callback?
yep
hmm
maybe the bot doesnt have a command triggered to respond to
A button is an interaction
oh so its like a command
so it would be responding to that interaction
Not sure what's happening, then.
maybe because when deleting the channel it even deletes the response of the bot
Well, yes.
don't use the command in the channel you're wanting to destroy
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?
sorry i don't understand
when you create the button, pass the ID of the target channel in the custom_id for the button
I tried but it doesnt work
show code
what I think is happening is that the purge is deleting the defer message
therefore it can't be edited
can you pass None to limit?
You can.
It will just default to the 100 then?
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
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
Most likely. you could add a check for the original message and have it be ignored and use a delete_after to clean it up later
That's what I was thinking