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 User3y ago
Message Not Public
Sign In & Join Server To View
txj
txjOP3y ago
node -v: 17.6.0
Syjalo
Syjalo3y ago
Do you have Unknown Interaction error?
txj
txjOP3y 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 docs3y ago
Suggestion for @txj:guide Interactions: Replying to slash commands - Deferred responses read more
txj
txjOP3y ago
Hmm point is being missed here Hmm
Syjalo
Syjalo3y ago
You still use Promises and a Promise can resolve after 3 seconds. So you should defer reply.
txj
txjOP3y ago
Thats not an issue at all Its properly handled its just the order of which you respond
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
txj
txjOP3y 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
Want results from more Discord servers?
Add your server