I'm working on coding a bot that will retrieve an image based on search parameters. When the bot returns the message after the command, I want the bot to alert the user that sent the command with a ping. (the notification of a message using the "@
" symbol in discord).
Here's what I've got so far:
await Context.Channel.SendMessageAsync("@" + Context.Message.Author + "\n" + imageNode.Attributes["src"].Value);
I'm able to correctly grab the author of the command and it sends as it should--
Output in channel:
However, it's not actually sent as a tag, just plain text.
Is there a way to actually ding the user with a notification?
Yes, using User.Mention
.
await Context.Channel.SendMessageAsync(Context.Message.Author.Mention + "\n" + imageNode.Attributes["src"].Value);
You can also just put their id in between <@>
. For example, "Hello <@1234>"