unfurl_links: false works with chat.postMessage but not with chat.scheduleMessage
@hello-ashleyintech is already working on this.
Since Sep 29, 2022.
- Dominant language
- TypeScript
- Stars
- 2.9k
- Forks
- 445
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 28
Description
Description
Specifying unfurl_links: false seems not working for scheduleMessage method, but it works fine for postMessage. I send a couple of links, and a result message becomes a bit messy if all the links get previews so I would like to prevent automatic links unfurling. It's worth mentioning that I run scheduleMessage in a cron job, and send time varies from a couple of minutes to 12 hours but the result is always the same.
Here is a Slack doc about unfurling
What type of issue is this? (place an x in one of the [ ])
- bug
- enhancement (feature request)
- question
- documentation related
- example code related
- testing related
- discussion
Requirements (place an x in each of the [ ])
- I've read and understood the Contributing guidelines and have done my best effort to follow them.
- I've read and agree to the Code of Conduct.
- I've searched for any related issues and avoided creating a duplicate issue.
Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
Reproducible in:
package version: 3.8.1
node version: v14.17.1
OS version(s): MacOS 11.6, linux-based OS on remote server
Steps to reproduce:
- Call
chat.scheduleMessagemethod withunfurl_links: falseparam
Expected result:
The scheduled message will not be automatically unfurled after being sent to a user. The same way as if you specify unfurl_links: false for chat.postMessage
Actual result:
The scheduled message will be automatically unfurled after being sent to a user
Attachments:
The result message will be unfurled
const response = await app.client.chat.scheduleMessage({
channel: user.channel_id,
post_at: timestamp,
token: team.bot_token,
blocks: [{
type: 'section',
text: {
type: 'mrkdwn',
text: `${welcomeMessage}\n${joinedSkills}`
}
}],
text: welcomeMessage,
unfurl_links: false,
unfurl_media: false
});
The result message will not be unfurled
const response = await app.client.chat.postMessage({
channel: user.channel_id,
token: team.bot_token,
blocks: [{
type: 'section',
text: {
type: 'mrkdwn',
text: `${welcomeMessage}\n${joinedSkills}`
}
}],
text: welcomeMessage,
unfurl_links: false,
unfurl_media: false
});
Interface of scheduleMessage arguments in typescript. It's the reason why I actually try to send this param
export interface ChatScheduleMessageArguments extends WebAPICallOptions, TokenOverridable {
channel: string;
text?: string;
post_at: string | number;
as_user?: boolean;
attachments?: MessageAttachment[];
blocks?: (KnownBlock | Block)[];
link_names?: boolean;
parse?: 'full' | 'none';
reply_broadcast?: boolean;
thread_ts?: string;
unfurl_links?: boolean;
unfurl_media?: boolean;
team_id?: string;
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.