How to get a thread_ts as a response from the Slack API using Google Appscript? Here's my code.
function postToSlack() {
var payload = {
channel: "#slackbot-test",
username: "my test",
icons_url: "",
text: "<@username>testing<#>",
};
var options = {
method: "post",
contentType: "application/json",
payload: JSON.stringify(payload),
};
response = slack_client.chat_postMessage(
(channel = receiver),
(text = message)
);
console.log(response.data);
thread_ts = response.data["ts"];
console.log(thread_ts);
console.log("Message sent: ", payload);
return UrlFetchApp.fetch(webhookUrl, options);
}