Skip to main content

Threads

A thread is a temporary side conversation inside a channel. Ticket systems, support posts and forum channels are all built out of them.

Show the whole Threads flyout

The Threads subcategory

Creating a thread​

Create thread from a message

start a thread in the message attaches a thread to an existing message. Everyone who can see the message can see the thread.

Create thread in a channel

start a thread in the channel creates a standalone thread with no starter message.

Both blocks take:

FieldWhat it is
NameThe thread title.
SlowmodeSeconds between messages, 0 for none.
TypePublic, Private, or Announcement.
thenBlocks that run once the thread exists.

Created thread

Inside the then part, created thread is the new thread. Use it to send the first message, add people, or store its ID.

info

Private threads need a boosted server on some Discord plans. If creation fails, try a public thread first to rule this out.

Finding a thread​

BlockReturns
get thread by nameA thread in a channel, by name.
has threadTrue when a message has a thread on it.
thread of messageThe thread attached to a message.
is message in threadTrue when a message was sent inside a thread.
thread a message is inThe thread a message is in.

Reading a thread​

BlockReturns
nameThe thread's name.
idIts ID.
created atWhen it was created.
authorThe user who started it.
author memberThe same person, as a member of the server.
last messageThe most recent message in it.
member countHow many people have joined it.
parent channelThe channel the thread lives in.
is statusWhether the thread is locked, archived or invitable.

Managing a thread​

BlockWhat it does
renameRenames the thread.
archiveArchives or unarchives it. Archived threads drop out of the channel list.
lockLocks it, so only moderators can send messages.
slowmodeSets the seconds between messages.
pinPins the thread in a forum channel.
unpinUnpins it.
joinAdds the bot to the thread.
leaveRemoves the bot from it.
add userAdds someone to the thread.
remove userRemoves someone.
deleteDeletes the thread and everything in it.

Events​

For the moment a thread is created or deleted, see Thread Actions.

A worked example: a ticket system​

  1. A button with the ID ticket_open, in a message pinned in your support channel.
  2. In when a button is clicked, check the ID.
  3. start a thread in the channel, private, named after the person who clicked.
  4. In the then part, add user to thread with user of the interaction, and send a first message explaining what to do.
  5. A second button, ticket_close, which sets the thread to locked and then archived.
  6. Reply to the original click, visible only to the user, with a link to their thread.