jammerware / margiebot

MargieBot is a .NET library designed to make building bots for Slack fast, easy, and fun.
MIT License
122 stars 42 forks source link

Mention users? #19

Closed andrewcartwright1 closed 8 years ago

andrewcartwright1 commented 8 years ago

Hi,

In my project I'm replacing Jira usernames with Slack usernames and attempting to mention that user in the bots response, however when the bot responds its just plain text despite @andrew.cartwright being in the bots response.

Is there a way to make the bot mention these users?

jammerware commented 8 years ago

Hey Andrew,

In order to make the text of the bot's reply actually mention the user with an actual link, you have to do a little special formatting when you're composing the bot's reply. The official Slack API describes this here: https://api.slack.com/docs/message-formatting#linking_to_channels_and_users

Margiebot's User model lets you do this kind of formatting easily. I did it one of the example responders, actually - you can see that here: https://github.com/jammerware/margiebot/blob/master/MargieBot.SampleResponders/src/Responders/ScoreResponder.cs

Let me know if you have any more questions.

On Wed, Aug 3, 2016 at 5:01 AM Andrew Cartwright notifications@github.com wrote:

Hi,

In my project I'm replacing Jira usernames with Slack usernames and attempting to mention that user in the bots response, however when the bot responds its just plain text despite @andrew.cartwright being in the bots response.

Is there a way to make the bot mention these users?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jammerware/margiebot/issues/19, or mute the thread https://github.com/notifications/unsubscribe-auth/AASEYs5jPb5pL4rc_g_2kw2XaRBDQQROks5qcFjTgaJpZM4Jbcr6 .

andrewcartwright1 commented 8 years ago

Got it, thanks :)