How to Decide Which Link to Preview and Position Link Previews in a Message Using Pipedream and Telegram's New Features?

This topic was automatically generated from Slack. You can find the original thread here.

In pipedream how can i decide which link to preview in a message if i have two links? furthermore Telegram released new features about previews (Replies 2.0, Adjustable Link Previews, Name Colors and More) and how can i put a link preview below or above the message ?

In Pipedream, the placement of link previews in a message is typically determined by the platform you’re sending the message to, such as Slack or Telegram, and not by Pipedream itself. For Telegram, based on the link you provided, it seems that you can adjust link previews by using the disable_web_page_preview parameter in the sendMessage method. If you set disable_web_page_preview to true, it will disable link previews for links in the message. However, the ability to place a link preview above or below the message is not mentioned in the Telegram API documentation. Here’s an example of how you might send a message with the link preview disabled using the Telegram API in a Pipedream workflow: import { axios } from "@pipedream/platform"; export default defineComponent({ props: { telegram: { type: "app", app: "telegram_bot", }, chat_id: { type: "string", label: "Chat ID", description: "The unique identifier for the target chat or username of the target channel", }, text: { type: "string", label: "Text", description: "Text of the message to be sent", }, }, async run({ steps, $ }) { return await axios($, { method: "POST", url: `https://api.telegram.org/bot${this.telegram.$auth.bot_token}/sendMessage`, data: { chat_id: this.chat_id, text: this.text, disable_web_page_preview: true, }, }); }, }); In this example, replace chat_id and text with the ID of the chat you want to send the message to and the text of the message, respectively. Remember, you should always refer to the specific platform’s API documentation for the most accurate and up-to-date information. For Telegram, you can find more details at Telegram Bot API.

I have a pdf in the link to be previewed but it doesn’t work when the channel is updated via pipedream workflow

In Pipedream, when you’re sending a message to a platform like Slack or Telegram, the ability to preview a PDF or any other link is typically controlled by the platform you’re sending the message to, not by Pipedream itself. For example, if you’re sending a message to a Slack channel, Slack controls whether a PDF preview is generated for a link in a message. Pipedream simply sends the message content you specify to Slack’s API. If a PDF preview is not being generated, it could be due to a few reasons: 1. The platform (like Slack or Telegram) might not support PDF previews. You would need to check the platform’s documentation or contact their support to confirm this. 2. The link to the PDF might be formatted incorrectly or the PDF might not be accessible from the platform. You should check that the link works correctly by pasting it directly into a channel on the platform. 3. The platform might have settings or permissions that control link previews which are preventing the PDF preview from being generated. You would need to check the platform’s settings and permissions. If you’re still having trouble, could you provide more details about what you’re trying to do? For example, which platform are you sending the message to? What is the content of the message? Are there any error messages? This additional information would help me provide a more accurate answer.

with pipedream how can i decide which link to preview in a message if i have two links in the sent message ?

In Pipedream, the control over which link to preview in a message is typically determined by the platform you’re sending the message to, such as Slack or Telegram, and not by Pipedream itself. For example, if you’re sending a message to a Slack channel, Slack controls which link previews are generated for links in a message. Pipedream simply sends the message content you specify to Slack’s API. If you want to control which link is previewed, you might consider sending two separate messages, each with one of the links. This way, you can control the order of the link previews by controlling the order of the messages. However, the specifics can vary depending on the platform you’re using. If you could provide more details about the platform you’re sending the message to and the specific behavior you’re trying to achieve, I could potentially provide a more accurate answer.