slack-api

Open URL in browser from Message Button using Slack API

淺唱寂寞╮ 提交于 2020-07-20 07:04:54
问题 I am sending the users a slack message with a button through a Slack App. On every click of the button, I generate a new URL. At the moment, I am able to return the URL back as a message. The user clicks on the message to open the URL in the browser. Instead of the sending a message back, I want to open the URL directly in the browser using slack API. How can I accomplish it? I can't seem to find anything in the documentation that does that. Thanks PS: Google Drive integration does that

Open URL in browser from Message Button using Slack API

亡梦爱人 提交于 2020-07-20 07:04:33
问题 I am sending the users a slack message with a button through a Slack App. On every click of the button, I generate a new URL. At the moment, I am able to return the URL back as a message. The user clicks on the message to open the URL in the browser. Instead of the sending a message back, I want to open the URL directly in the browser using slack API. How can I accomplish it? I can't seem to find anything in the documentation that does that. Thanks PS: Google Drive integration does that

Open URL in browser from Message Button using Slack API

霸气de小男生 提交于 2020-07-20 07:03:44
问题 I am sending the users a slack message with a button through a Slack App. On every click of the button, I generate a new URL. At the moment, I am able to return the URL back as a message. The user clicks on the message to open the URL in the browser. Instead of the sending a message back, I want to open the URL directly in the browser using slack API. How can I accomplish it? I can't seem to find anything in the documentation that does that. Thanks PS: Google Drive integration does that

How to use a Websocket client to open a long-lived connection to a URL, using PowerShell V2?

浪尽此生 提交于 2020-07-18 05:59:36
问题 I am trying to use PowerShell V2 (testing purposes) to initiate a real-time messaging (rtm) instance with Slack. But according to Slack's FAQ, to connect to their rtm API, I need to use the wss:// protocol via a Websocket client to stream events associated. I am also trying to make it an asynchronous connection (receiving as well as connecting). This doesn't work : $webSock = New-Object System.Net.WebSocket.ClientWebSocket $client = New-Object System.Threading.CancellationToken One other

Recurring (daily) messages to a specific channel by my Slack App

微笑、不失礼 提交于 2020-07-03 07:31:31
问题 I'm writing a slack app which provides some stats about a service by demand using slash commands. The command calls my web api, I calculate stuff and return a formatted JSON that slack parses as a message. I would like to do the same but automatically, every day, at midnight. What I could do is set up the scheduling in my own server and call a webhook, which would be fine except that I want my service to be simple, passive, stateless and just respond to requests. Is there a way to set up

not able to post message to slack with slack api and javascript?

自作多情 提交于 2020-06-17 09:43:48
问题 I had created an chat tab and in that I had showed the users list using slack access token now when I click the user the respective user id and input tag and send button will be shown the html css and js code is like this THE CODE PEN LINK IS THIS: https://codepen.io/lakshmi123__/pen/yLYGoVP Now I had wrote js code for posting a message to the user window.onload = function(){ var form = document.getElementById('msg_send_btn'); var input = document.getElementById("write_msg").value var channel

How to create a Slack message containing an uploaded image?

本秂侑毒 提交于 2020-05-23 17:28:02
问题 I'd like to create a message in the #general channel of my Slackspace from within a PHP script. The message should contain text and an image which was created locally on-the-fly. I've already created an App, generated an bearer token and have managed to create an text-only message also as an image-upload. But i didn't know how to create both in one message , as the procedure above creates two messages, one with text and another one with the image. 回答1: There are two different approaches on

How can I color part of Slack incoming-webhook messages?

孤者浪人 提交于 2020-05-23 05:46:53
问题 I want to compose a python script which sends a color-formatted message to a configured slack channel. I managed to send sentences of plain texts to slack channels but I could not figure out how to confer part of the sentences colors that I want. I used slackweb library in python as below import slackweb slack = slackweb.Slack(url = url_of_the_configured_channel) string_to_send = "test TEST" payload = {'text' : string_to_send} slack.notify(text=string_to_send) how can I, say, format string_to

How can I color part of Slack incoming-webhook messages?

六月ゝ 毕业季﹏ 提交于 2020-05-23 05:46:05
问题 I want to compose a python script which sends a color-formatted message to a configured slack channel. I managed to send sentences of plain texts to slack channels but I could not figure out how to confer part of the sentences colors that I want. I used slackweb library in python as below import slackweb slack = slackweb.Slack(url = url_of_the_configured_channel) string_to_send = "test TEST" payload = {'text' : string_to_send} slack.notify(text=string_to_send) how can I, say, format string_to

“Failed RTM connect” error when trying to connect to Slack with RTM API

允我心安 提交于 2020-05-13 13:41:18
问题 I'm using the following Python code from Slack's "Migrating to 2.x" github docs from slackclient import SlackClient slack_token = os.environ["SLACK_API_TOKEN"] client = SlackClient(slack_token) def say_hello(data): if 'Hello' in data['text']: channel_id = data['channel'] thread_ts = data['ts'] user = data['user'] client.api_call('chat.postMessage', channel=channel_id, text="Hi <@{}>!".format(user), thread_ts=thread_ts ) if client.rtm_connect(): while client.server.connected is True: for data