26 lines
No EOL
663 B
JavaScript
26 lines
No EOL
663 B
JavaScript
import { axios } from "@pipedream/platform";
|
|
export default defineComponent({
|
|
props: {
|
|
slack: {
|
|
type: "app",
|
|
app: "slack_bot",
|
|
}
|
|
},
|
|
async run({ steps, $ }) {
|
|
const response = await axios($, {
|
|
method: "GET",
|
|
url: "https://slack.com/api/chat.getPermalink",
|
|
headers: {
|
|
Authorization: `Bearer ${this.slack.$auth.bot_token}`,
|
|
},
|
|
params: {
|
|
channel: steps.route_check.$return_value.fromChannel,
|
|
message_ts: steps.route_check.$return_value.messageTs,
|
|
},
|
|
});
|
|
if (!response.ok) throw new Error(response.error);
|
|
return {
|
|
permalink: response.permalink,
|
|
};
|
|
}
|
|
}); |