Skip to content

[BUG] app_mentioned event response object returning simplified message text #473

@mfcarroll

Description

@mfcarroll

The deno-slack versions

    "deno-slack-sdk/": "https://deno.land/x/[email protected]/",
    "deno-slack-api/": "https://deno.land/x/[email protected]/",

Deno runtime version

deno 1.46.2 (stable, release, aarch64-apple-darwin)
v8 12.9.202.5-rusty
typescript 5.5.2

OS info

ProductName:		macOS
ProductVersion:		15.5
BuildVersion:		24F74
Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:29 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6030

Describe the bug

The TriggerContextData.Event.AppMentioned.text object returns a simplified rendering of the message, rather than the markdown with user tags and formatting.

Steps to reproduce

  1. Create a trigger that listens for an app mention.
  2. Log TriggerContextData.Event.AppMentioned.text

Expected result

As per the documentation, I expect the mrkdwn version of the text of the message:

{
  "team_id": "T0123ABC",
  "enterprise_id": "E0123ABC",
  "event_id": "Ev0123ABC",
  "event_timestamp": 1643810217.088700,
  "type": "event",
  "data": {
    "app_id": "A1234ABC",
    "channel_id": "C0123ABC",
    "channel_name": "cool-channel",
    "channel_type": "public/private/dm/mpdm",
    "event_type": "slack#/events/app_mentioned",
    "message_ts": "164432432542.2353",
    "text": "<@U0LAN0Z89> is it everything a river should be?",
    "user_id:": "U0123ABC",
  }
}

In my case:

<@U08LX9Y2YDT> testing

Actual result

@Standbot (local) testing

In the case of the documentation this would be like it instead returning:

    "text": "@App Name is it everything a river should be?",

If this is by design, the documentation should be updated to reflect the behaviour, but given that other places in the sdk return the mrkdwn text without it being flattened, it looks to me like this is a bug.

The workaround, of course, is to just pull the original message using the message_ts parameter, which returns the expected result in its text parameter, e.g.:

await postEphemeral(channelId, userId, "`" + text + "`");

const message = await getSingleMessage(inputs.messageTs, channelId);
await postEphemeral(channelId, userId, "`" + escapeSlack(message.text) + "`");

@Standbot (local) testing

<@U08LX9Y2YDT> testing

The relevance here is my app needs to parse other tags for users later in the message, and that requires the user id rather than the @Username rendering.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds infonot enough information to reproduce or continueserver-sideissue with Slack HTTP API

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions