Skip to main content
mention_user() turns a canonical human identity into the platform’s native @mention, so the right person gets a real ping in a shared channel. Here’s a real example: a deploy agent posts in #deploys (Slack), where Alice, Bob and the bot are all members. Bob is on call:

Quick Start

1

Mention someone by canonical id

Link the human once in an identity resolver, then pass the same resolver to Bot. Once the bot starts, bot.adapter.mention_user("alice") returns the native markup.
2

Fallback when the person isn't linked here

If the person has no link on this platform, you get the id back as plain text. Your message still goes out; it just doesn’t ping anyone.
3

Use the unlinked platform:id shortcut

If you already know this platform’s native id, pass "{platform}:{native_id}". The bot skips the resolver.

How It Works

  1. If the platform has no mention template, it can’t ping by id, so the id comes back as plain text.
  2. A "{platform}:{native_id}" id whose prefix matches this adapter is rendered directly. The resolver isn’t called.
  3. Otherwise the adapter calls links_for() on its identity resolver. Bot, BotOS and the gateway attach the resolver automatically.
  4. The adapter uses the link for its own platform to render the mention, for example <@222>.
  5. If there’s no link for this platform, or the lookup raises, the id comes back as plain text. A lookup error is logged as a warning and the reply is never lost.

Which form do I pass?


Configuration Options

There is nothing to configure: mention_user(unified_user_id) takes a single argument and returns a string. Full API: Bots SDK reference.

Common Patterns

Handoff ping
Approval request
Multi-recipient alert

Best Practices

Pass "alice", not "222". The same agent code then works unchanged on Slack, Discord, or any other channel.
If someone isn’t paired on this platform, they’re named in plain text. The message is still delivered and nothing crashes.
A canonical id only becomes a native mention after it’s linked. See Bot Pairing to set up the links.
Let mention_user() produce the markup. Each adapter owns its template, so you can swap platforms without changing your code.

Bot Pairing

How a human becomes a canonical identity

Identity Canonicalization

The identity map the resolver reads

Implicit Mentions

The inbound counterpart

Bot Gateway

Where channel adapters are wired