The message argument in app.message listeners does not provide sufficient properties in TypeScript.
Property 'user' does not exist on type 'KnownEventFromType<"message">'. Property 'user' does not exist on type 'MessageChangedEvent'.ts(2339)
A workaround is to cast the message value by (message as GenericMessageEvent).user but needless to say, this is not great.
I ran into this today also. Trying to use the official example from https://slack.dev/bolt-js/concepts
// This will match any message that contains 👋
app.message(':wave:', async ({ message, say }) => {
await say(`Hello, <@${message.user}>`);
});
and immediately getting a ts compile error. This is not a great first-time experience. Not even sure how to get it working.
Originally posted by @memark in #826 (comment)
The
messageargument inapp.messagelisteners does not provide sufficient properties in TypeScript.A workaround is to cast the
messagevalue by(message as GenericMessageEvent).userbut needless to say, this is not great.I ran into this today also. Trying to use the official example from https://slack.dev/bolt-js/concepts
and immediately getting a ts compile error. This is not a great first-time experience. Not even sure how to get it working.
Originally posted by @memark in #826 (comment)