user7466895
user7466895

Reputation: 319

Java Discord bot, @mention a user?

There doesn't seem to be much about this on google aside from advising to use their userID (a string of numbers) instead of their name.

I enabled dev mode to grab their ID and tried the below however it just comes out as a plain text message with no @mention.

chan.sendMessage("Hey @299059199160352768 are you there?").queue();

Any ideas?

Upvotes: 5

Views: 10316

Answers (1)

Wright
Wright

Reputation: 3424

Just add an opening and closing angle bracket. <@id>. So your string would look like

chan.sendMessage("Hey <@299059199160352768> are you there?").queue();

Upvotes: 9

Related Questions