connected-web / gamebot

A slackbot for board games and games channels. Responds to gameplay related chatter.
2 stars 0 forks source link

Slack @username is being deprecated #49

Closed Markavian closed 5 years ago

Markavian commented 7 years ago

The slack username field is being deprecated, affecting how messages are formatted on the platform. This will cause oddities with how messages are delivered to users during gameplay.

https://api.slack.com/changelog/2017-09-the-one-about-usernames

Mentioning users in messages

We're preserving the old ways for as long as we can but your practices may need to change.

  • The user mentioning syntax <@W123|bronte> is now deprecated and will eventually be removed. Slack will use the "display name" when rendering all mentions.
  • Use the simpler user ID-only form <@W123> instead.
  • Using link_names when posting messages is also deprecated. We'll continue matching @mentions with usernames, but for now please mention users with the <@W123> user ID format instead.
  • When evaluating messages to determine if your user or bot user is mentioned, look for a user ID, not a username.
  • Bots still have a username but we advise you to start thinking of your app's name as your app's display name.
  • Unfortunately, an undocumented approach to mentioning users — <@username> — no longer functions. Please reference with the user ID format (<@U123>) instead.
johnbeech commented 5 years ago

This has been resolved; it is standard across gamebot to use api.mention(search) to find and mention a user; to generate the new <@userid> template in a response.