discord-php / DiscordPHP

An API to interact with the popular messaging app Discord
MIT License
985 stars 236 forks source link

Need help to post a message to a thread #1078

Closed BlutVampir closed 1 year ago

BlutVampir commented 1 year ago

I really struggle with a lot of things

I want to post a message to a thread. I have the thread_id which can get via: $channel->threads ...

I tried to set: $channel = $discord->getChannel($thread_id); which is not working and delivers a NULL.

I tried to: $message = MessageBuilder::new()->setContent("Debug: test")->setReplyTo($thread_id);

which is also not woking. How can I get a Message posted to the thread?

Additionally I want afterwards to get all messages of the thread to:

$channel->getMessageHistory(['limit' => 50])->done(function (Collection $messages) { print_r($messages); });

this code is not woking, equalless if in a cannel or thread..

Can a Function

$thread = $discord->getChannel($thread_id)->getThread(thread_id); be implemented?

Or how can I manage these things?