threadUpdate
Code:
Error:
What I Am Trying To Do:
I am trying to have the bot remove a certain tag if the post is re-opened.
if (newThread.parentId === '1083539122083352589') {
if (!oldThread.appliedTags.includes('1083616112060661892') && newThread.appliedTags.includes('1083616112060661892')) {
await newThread.send('This thread has been marked as solved.\n The thread will be closed shortly.');
await wait(5000);
await newThread.setArchived(true);
}
}
if (newThread.parentId === '1083539122083352589') {
if (oldThread.archived && !newThread.archived) {
const jsremovetag = newThread.appliedTags.filter(tag => tag !== '1083616112060661892')
await jsremovetag.setAppliedTags(jsremovetag)
await newThread.send('This thread has been opened again. Please make sure you have the correct tags on the post.\n Use </get-help:1084975333968707685> to request a coding helper.');
}
} if (newThread.parentId === '1083539122083352589') {
if (!oldThread.appliedTags.includes('1083616112060661892') && newThread.appliedTags.includes('1083616112060661892')) {
await newThread.send('This thread has been marked as solved.\n The thread will be closed shortly.');
await wait(5000);
await newThread.setArchived(true);
}
}
if (newThread.parentId === '1083539122083352589') {
if (oldThread.archived && !newThread.archived) {
const jsremovetag = newThread.appliedTags.filter(tag => tag !== '1083616112060661892')
await jsremovetag.setAppliedTags(jsremovetag)
await newThread.send('This thread has been opened again. Please make sure you have the correct tags on the post.\n Use </get-help:1084975333968707685> to request a coding helper.');
}
}Error:
node:events:491
+ throw er; // Unhandled 'error' event
^
8TypeError: jsremovetag.setAppliedTags is not a function
H at module.exports (/home/node/events/discord/threadUpdate.js:14:33)
( at Client.emit (node:events:513:28)
� at module.exports [as THREAD_UPDATE] node:events:491
+ throw er; // Unhandled 'error' event
^
8TypeError: jsremovetag.setAppliedTags is not a function
H at module.exports (/home/node/events/discord/threadUpdate.js:14:33)
( at Client.emit (node:events:513:28)
� at module.exports [as THREAD_UPDATE] What I Am Trying To Do:
I am trying to have the bot remove a certain tag if the post is re-opened.