getting a thread from an interaction
i have a button that locks a thread once it's clicked
only issue is i cant seem to figure out how to save the thread into a variable.
Im not sure how, as previously you'd just say "interaction.<thing>" to get something from the interaction but here it doesnt work.
18 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ✅
Marked as resolved by OPping in reply pls!
@Comet is the button in the thread like this one?
yes, it's the first message in the thread as well
then
<ButtonInteraction>.channel
is the ThreadChannel
it's taking this as undefined
what would <ButtonInteraction> mean here? just making sure i understood you correctly
well
<Interaction>.channel
should never be undefined
even if not present (it'd be null
instead)care to share your code?
Pastebin
if ( interaction.isButton() && interaction.customId =...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
just console logged it and it says undefined to double check
I didn't mean
ButtonInteraction.channel
interaction
is your ButtonInteraction
instance in this caseah, even when i tried that it returned the same thing
ill try again to make sure
big message appeared
<ref *1 thread channel{
it then displays info about the serverthat definitely sounds like you're paraphrasing, but it sounds like you're looking at a
ThreadChannel
it seems like yes, it's a big wall of text so i didnt wanna clutter the post
but after it, i just saw that it mentioned
Error closing ticket: TypeError: thread.setArchive is not a function
the method is setArchived
im sorry for bothering you with this lmao
all good now, thank you