Skip to content

Creating thread via command #1209

Answered by SQKo
civilCornball asked this question in Q&A
Discussion options

You must be logged in to vote

The method you are looking for is Channel::startThread() in the documentation: https://discord-php.github.io/DiscordPHP/classes/Discord-Parts-Channel-Channel.html#method_startThread available since v10

After thread is created in forum, you can also send a message using Thread::sendMessage()

Lacking in documentation, here is the example:

// Start thread (Channel type must be forum)
$channel->startThread([
    'name' => 'New forum post',
    'message' => MessageBuilder::new()->setContent('Post content here'),
    // more options here from the relevant discord documentation that you found
])->then(function (Thread $thread) {
    // make another message
    return $thread->sendMessage(Message…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@civilCornball
Comment options

Answer selected by civilCornball
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants