Open a thread automatically on every message posted in #introductions, named after the author
Automatically creates a thread on every message posted in your introductions channel, named after the member who posted.
How it works:
Setup: Configure the introductions channel setting below, then the creation works automatically — no commands needed.
Made by MEE6. Remix it to get a copy of your own and change anything you like.
// Auto-thread creation for introduction messages
// Opens a thread on every message in the configured channel
mee6.settings({
intro_channel: {
type: 'channel',
label: 'Introductions channel',
required: true,
sample: 'introductions',
},
});
// Only messages in the configured channel wake the module (none while it is not set)
mee6.on('message', { channels: [mee6.setting('intro_channel')] }, async (ctx) => {
// Don't create threads on bot messages
if (ctx.author.bot) {
return;
}
// Create a thread named after the author
const threadName = `${ctx.author.displayName}'s introduction`;
try {
const thread = await ctx.createThread(threadName);
mee6.log(`Created thread "${threadName}" (${thread.threadId}) for message ${ctx.messageId}`);
} catch (error) {
mee6.log(`Failed to create thread: ${error}`);
}
});