Giter Club home page Giter Club logo

discord-auto-threader's Introduction

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

discord-auto-threader's People

Contributors

fredkschott avatar jasikpark avatar jonathantneal avatar marcusotter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.