Threads for coursework help channel
parent
d5cd6494e3
commit
aeb8f63ed0
|
@ -77,6 +77,15 @@ client.on("interactionCreate", async (interaction) => {
|
||||||
await interaction.message.delete();
|
await interaction.message.delete();
|
||||||
await interaction.reply({ content: 'Message has been deleted', ephemeral: true});
|
await interaction.reply({ content: 'Message has been deleted', ephemeral: true});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(interaction.isButton)
|
||||||
|
{
|
||||||
|
if(interaction.customId == "CloseThread")
|
||||||
|
{
|
||||||
|
interaction.reply(`This channel has been archived, you can unarchive this thread by sending another message.`)
|
||||||
|
interaction.channel.setArchived(true)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(interaction.isSelectMenu())
|
if(interaction.isSelectMenu())
|
||||||
|
|
|
@ -7,12 +7,31 @@ const discord = require('discord.js');
|
||||||
client.on("messageCreate", async (message) => {
|
client.on("messageCreate", async (message) => {
|
||||||
if(message.channel.id == "969944638498680875")
|
if(message.channel.id == "969944638498680875")
|
||||||
{
|
{
|
||||||
await message.startThread({
|
const row = new MessageActionRow()
|
||||||
name: `${message.author} - ${messageArgs}`,
|
.addComponents(
|
||||||
|
new MessageButton()
|
||||||
|
.setCustomId('CloseThread')
|
||||||
|
.setEmoji('<:archive:937932140014866492> ')
|
||||||
|
.setLabel('Archive Thread')
|
||||||
|
.setStyle('SUCCESS')
|
||||||
|
)
|
||||||
|
|
||||||
|
const thread = message.startThread({
|
||||||
|
name: `${message.author.tag} - ${message}`,
|
||||||
autoArchiveDuration: 60,
|
autoArchiveDuration: 60,
|
||||||
type: 'GUILD_PUBLIC_THREAD'
|
type: 'GUILD_PUBLIC_THREAD'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
(await thread).send({
|
||||||
|
content: `Hey <@${message.author.id}>! I've automatically created this thread from your message to keep the channel clean and keep messages condensed.
|
||||||
|
\nIt is recommended that you change the Notification Settings for this thread to All Messages so that you get a notification when someone has responded to your query.
|
||||||
|
\nPinging <@&904354161561309184> so that they see this as well!`,
|
||||||
|
components: [row]
|
||||||
|
});
|
||||||
|
|
||||||
|
(await thread).leave();
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
message.author.bot ||
|
message.author.bot ||
|
||||||
!message.guild ||
|
!message.guild ||
|
||||||
|
@ -30,7 +49,4 @@ client.on("messageCreate", async (message) => {
|
||||||
if (!command) return;
|
if (!command) return;
|
||||||
await command.run(client, message, args);
|
await command.run(client, message, args);
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
});
|
Loading…
Reference in New Issue