Mention a user in oktokit.issues.createComment

I’ve configured a probot in my repo (probot/stale) and it’s behaving all fine and dandy, posting comments in my issues when I expect it.

However, I’d like to mention a user when it calls oktokit.issues.createComment. It’s posting the body of the comment as plain text, and not picking up on the @ mention of the user.

https://octokit.github.io/rest.js/v18#issues-create-comment

octokit.issues.createComment({
  owner,
  repo,
  issue_number,
  body: "Update text and mention @user",
});

Any suggestions on what I could provide to the body param that would result in the @user mention instead of just plaintext?

This doesn’t feel like a bug in probot/stale to me, but just missing oktokit documentation.

2 Likes

I use ruby gem octokit for it, the only thing i can confirm is mention single user works for me.
I can’t see anything wrong with your approach,
this is mine just fyi

OctokitWithAppAuth.add_comment(repo pr_number, "a test message and mention something @user")

Maybe check the permission of your app, see it has all read/write permission