A discord bot that makes a new thread for every message in certain channels.
Message | Thread |
---|---|
- Edit the
src/config/config.json
with API token and the IDs of the channels you want to thread every message in:{ "discordApiToken": "INSERT TOKEN HERE", "threadChannels": [ "CHANNEL ID 1 HERE", "CHANNEL ID 2 HERE", "ETC" ] }
- Run
npm install
- Run
npm start
- Make sure the bot has the required permissions in Discord. Depending on your configuration, these can be:
- Done! ๐
If you want to, you can configure how the bot reacts by editing the src/config/config.json
file. Here are the default settings:
"threadArchiveDurationInMinutes": "MAX",
"threadMessage": {
"shouldSend": true,
"shouldPin": true,
"content": "Thread created from $$channelMention by $$authorMention $$relativeTimeSince with the following message:",
"embeds": [
"$$messageEmbed"
]
}
An explanation follows.
Determines the duration of inactivity that causes a thread to be automatically archived (by Discord). If your server's boost level is not high enough for the setting you choose, or if you leave it blank, it will default to "MAX"
.
Allowed values:
60
(= 1hr)1440
(= 1d)4320
(= 3d)โ ๏ธ only for servers with boost level 1 or higher10080
(= 1w)โ ๏ธ only for servers with boost level 2 or higher"MAX"
(depends on the server's boost level)
Settings regarding the message that is sent by the bot in the thread when it is created.
Whether or not to send a message. If you set this to false
, the rest of these settings are ignored.
Whether or not to pin the message that was sent by the bot. If you set this to false
, the bot does not need the MANAGE_MESSAGES
permission.
The text content of the message that is sent. Available variables:
$$authorMention
- A mention of the author that sent the original message$$channelMention
- A mention of the channel that the original message was sent in$$relativeTimeSince
- A relative timestamp for when the original message was posted
An array of the embeds to attach to the message, with a maximum of 10. Available embeds:
$$messageEmbed
- A copy of the original message in embed format