您如何使用 laravel 松弛通知 api 在 (@) 某个处于松弛状态的人?

How do you at (@) someone in slack using the laravel slack notification api?

我有一个正常运行的通知系统,可以 post 发送到我们公司 Slack 中的频道。然而,遇到的一切都只是文本。 linkNames 假设您的内容中有 find/link 个用户名。我看到它设置为“1”,但在频道中显示时没有任何影响。

 namespace App\Notifications;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Notification;
use Illuminate\Notifications\Messages\SlackMessage;
class Dd extends Notification
{
use Queueable;

/**
 * Create a new notification instance.
 *
 * @return void
 */
public function __construct()
{
    //
}

/**
 * Get the notification's delivery channels.
 *
 * @param  mixed  $notifiable
 * @return array
 */
public function via($notifiable)
{
    return ['slack'];
}


/**
 * Get the array representation of the notification.
 *
 * @param  mixed  $notifiable
 * @return array
 */
public function toArray($notifiable)
{
    return [
        //
    ];
}

/**
 * Get the Slack representation of the notification.
 *
 * @param  mixed  $notifiable
 * @return SlackMessage
 */
public function toSlack($slackComment)
{   
    $slackMessage = new SlackMessage();
    $slackMessage->linkNames();
    $slackMessage->from('Christopher');
    $slackMessage->to($slackComment->channel);
    $slackMessage->content("Harded coded for example @christopher <- this doesn't get linked to the user in slack but should");
     $slackMessage->info();
    //dd($slackMessage); // this shows that the linkedNames attribute has been set to "1"
    return $slackMessage;             
}

}

这是已知问题、版本不匹配,还是我遗漏了什么?

https://api.slack.com/reference/surfaces/formatting#mentioning-users

To mention a user in app-published text, you need to provide their user ID in the following syntax:

Hey <@U024BE7LH>, thanks for submitting your report.