Skip to content
This repository was archived by the owner on Nov 1, 2023. It is now read-only.
/ discord-threader Public archive

A discord bot that makes a new thread for every message in certain channels.

License

Notifications You must be signed in to change notification settings

4lch4/discord-threader

Repository files navigation

discord-auto-threader

A discord bot that makes a new thread for every message in certain channels.

Message Thread
image image

How to run the bot

  1. 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"]
    }
  2. Run npm install
  3. Run npm start
  4. Make sure the bot has the required permissions in Discord. Depending on your configuration, these can be:
    • USE_PUBLIC_THREADS (always required)
    • SEND_MESSAGES (always required)
    • READ_MESSAGE_HISTORY (always required)
    • EMBED_LINKS (required if there are any embeds)
    • MANAGE_MESSAGES (required if shouldPin is true)
  5. Done! 🎉

Configuration 🚧 UNDER CONSTRUCTION, NOT WORKING YET 🚧

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.

threadArchiveDurationInMinutes

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 higher
  • 10080 (= 1w) ⚠️ only for servers with boost level 2 or higher
  • "MAX" (depends on the server's boost level)

threadMessage

Settings regarding the message that is sent by the bot in the thread when it is created.

shouldSend

Whether or not to send a message. If you set this to false, the rest of these settings are ignored.

shouldPin

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.

content

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

embeds

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

About

A discord bot that makes a new thread for every message in certain channels.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •