Proper way to handle Close + Lock Forum Posts

Title, I'm creating a Slash command to close/open posts inside a forum to certain roles, you enter the post and type /close or /open I would like to lock and close the posts but it appears you cannot reply to the command?
await interaction.channel.setLocked(true);
await interaction.channel.setArchived(true);

// reply here ephermally
await interaction.channel.setLocked(true);
await interaction.channel.setArchived(true);

// reply here ephermally
11 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
txj
txj2y ago
node -v: 17.6.0
Syjalo
Syjalo2y ago
Do you have Unknown Interaction error?
txj
txj2y ago
Not necessarily Since the ephemeral response cannot be sent to a closed and locked channel, I'm wondering if its just smart to not do it this way since I cannot determine the results of lock & close -> respond to slash command after with result I have to do this slash command /close --> respond ephemeral -> lock + close -> edit response
d.js docs
d.js docs2y ago
Suggestion for @txj:guide Interactions: Replying to slash commands - Deferred responses read more
txj
txj2y ago
Hmm point is being missed here Hmm
Syjalo
Syjalo2y ago
You still use Promises and a Promise can resolve after 3 seconds. So you should defer reply.
txj
txj2y ago
Thats not an issue at all Its properly handled its just the order of which you respond
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
txj
txj2y ago
thats not the issue the interaction is deffered already nvm ill figure it out omfg you can do this ty fixed yepge issue was checking both situations