threadCreate event emitted only when a user create a thread

Hi it seems that the threadCreate event is emitted only when a user create a thread because when i create one manually the event is emitted but when it's a bot that creates one, it don't works
4 Replies
d.js toolkit
d.js toolkitā€¢11mo ago
- 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 OP
Sayrix
SayrixOPā€¢11mo ago
node v21.6.1
client.on("threadCreate", async (thread, newlyCreated) => {
console.log(thread, newlyCreated, 0);
});
client.on("threadCreate", async (thread, newlyCreated) => {
console.log(thread, newlyCreated, 0);
});
Do you add the bot to the thread?
no but when i create one myself i don't add it too The only reason I can think of that could cause this bug to exist is that when the bot creates the thread, there is no message, the user is directly added, whereas when I create one manually, the Discord client forces me to send a message in order to start the thread. He is admin
Sayrix
SayrixOPā€¢11mo ago
No description
Sayrix
SayrixOPā€¢11mo ago
Here is how i create the thread manually (event emitted) and here is the code to open the thread with the bot:
const thread = await interaction.channel.threads.create({
name: `Trade with @${interaction.user.username}`,
autoArchiveDuration: 4320,
type: Discord.ChannelType.PrivateThread,
invitable: false
});
const thread = await interaction.channel.threads.create({
name: `Trade with @${interaction.user.username}`,
autoArchiveDuration: 4320,
type: Discord.ChannelType.PrivateThread,
invitable: false
});
different Is there a way to log all events from the websocket so i can know if in raw the event is emitted by Discord
client.on("raw", async (packet) => {
if (packet.t === "PRESENCE_UPDATE") return;
console.log(packet);
});
client.on("raw", async (packet) => {
if (packet.t === "PRESENCE_UPDATE") return;
console.log(packet);
});
I don't received anything when opened the thread with the bot don't worked thats strange i will try adding all perms to the bot to the specific channel I received the CHANNEL_UPDATE when updated the perms wait Oh shit i feel so bad It was a permission problem sorry šŸ˜­
Want results from more Discord servers?
Add your server