Markoudstaal / node-red-contrib-discord-advanced

Recieve, send, edit and delete Discord messages in node-red.
MIT License
47 stars 16 forks source link

Working with threads #21

Closed javis86 closed 2 years ago

javis86 commented 2 years ago

Also @javis86 I know this is totally unrelated to the PR, but do you know how to work with Discord Threads?

Originally posted by @itsvrl in https://github.com/Markoudstaal/node-red-contrib-discord-advanced/issues/20#issuecomment-1088072466

@itsvrl

javis86 commented 2 years ago

I only test a thread creation with this code inside Function node and using "discordClient" node.

image

const channelData = msg.discord.channels.cache.get("954798049358671922");
const thread = await channelData.threads.create({
    name: 'food-talk',
    autoArchiveDuration: 60,
    reason: 'Needed a separate thread for food',
});

image

Here the info: https://discordjs.guide/popular-topics/threads.html#thread-related-gateway-events

javis86 commented 2 years ago

See documentation in wiki: https://github.com/Markoudstaal/node-red-contrib-discord-advanced/wiki/Examples#creating-a-thread