slack-api

How to avoid slack command timeout error?

时光怂恿深爱的人放手 提交于 2019-12-18 12:47:41
问题 I am working with slack command (python code is running behind this), it works fine, but this gives error This slash command experienced a problem: 'Timeout was reached' (error detail provided only to team owning command). How to avoid this ? 回答1: According to the Slack slash command documentation, you need to respond within 3000ms (three seconds). If your command takes longer then you get the Timeout was reached error. Your code obviously won't stop running, but the user won't get any

Sending message to different channel via slack webhook fails

半城伤御伤魂 提交于 2019-12-18 09:34:44
问题 I'm not sure if I am understanding the way how to use webhooks quite right, but: I want to send messages in different channels or to different users (not at once), without being involved in that conversation. My problem: I can only create webhooks for specific users, so I end up having a unique URL for every user / channel? If I use something like the "channel" parameter or even the "setReceipent" method from the library I use, it doensn't have any effect and only the channel / user the

Slack POST multiple messages to a channel at once

此生再无相见时 提交于 2019-12-18 07:05:56
问题 I need to post multiple bot replies (responses determined dynamically) to the same channel. The obvious way seems to be to do an HTTP POST for each message in succession using this API method: https://api.slack.com/methods/chat.postMessage Is there a way to send messages to Slack in bulk to post to the same channel? The order in which the messages get rendered need not be important for me. 回答1: No, there is no bulk variant. So you basically need to build your own bulk message sender. Keep in

Receiving too many requests in my Bot user from slack

痞子三分冷 提交于 2019-12-17 21:15:28
问题 I am trying to implement a bot user in slack, but right now when i send a message to slack as a user, my bot gets more messages requests than it should. The event that I have added to my bot user is message.groups. I don't know if the events can interferer with the normal flow of the conversation. In this log USER REQUEST is what the user sent to the bot and BOT AWSER is what bot sends. As you can see slack is receiving the same message (event_time is the same) two times in a row, when i send

Can I upload an image as attachment with Slack API?

江枫思渺然 提交于 2019-12-17 17:16:37
问题 I have integrated Slack API using cURL in my project. I want to send an image as my attachment. It works while sending full image path in image_url . But when I convert that image to base64 string and then pass it with image_url it doesn't go as attachment. So basically I want to post base64 string as my image attachment. Because I don't want to store the image on my server. {"attachments": [ { "fallback": "Required text summary of the attachment that is shown by clients that understand

Creating a Slack Webhook programmatically

≡放荡痞女 提交于 2019-12-14 02:18:41
问题 Is there a way I can use the Slack API to create an incoming and outgoing webhook for a channel I just created? 回答1: No, I do not think that feature exists, but you can just use any existing webhook with the newly created channel or use the Event API to get the same result. Incoming Webhooks You can redirect an incoming webhook to any channel by providing the channel name as parameter in your call. (see Channel override) Outgoing Webhooks Your existing outgoing webhook will work with any

Using Slack, how do you send direct message to user based on their "Member ID?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-13 10:51:26
问题 How do you send a direct message to a user in Slack, using their unique "Member ID". Slack seems to only accept a Slack handle as an acceptable username. I'm new to Slack and thanks in advance for the help (please let me know if this needs to be moved, etc.). 回答1: Assuming you meant user ID when you said "member ID", you can use that as channel parameter in chat.postMessage to send a direct message to that user. Example for user with User ID U12345678 : curl -X POST "https://slack.com/api

How to upload a file - NO image - and comment it at the same time to Slack via SlackAPI using c#

て烟熏妆下的殇ゞ 提交于 2019-12-13 04:27:13
问题 I can upload images to Slack via my SlackAPI and I can upload files and I can upload images with comments - but I can not do this with files that are no images. I'm sure it's a problem with my message-structure - have a look: All this is done via HttpClient! This is my working fileUpload-method: public MultipartFormDataContent SendFileToChannel() { var requestContent = new MultipartFormDataContent(); var fileContent = new StreamContent(GetFile.ReadFile()); requestContent.Add(new StringContent

Slack Oauth/Authorize API Call

血红的双手。 提交于 2019-12-13 01:54:23
问题 I'm new to OAuth (and the Slack API) and have a question regarding Step 1 of Slack's OAuth Flow. It says "Your web or mobile app should redirect users to the following url: https://slack.com/oauth/authorize". At first I thought I should do an XHR request but then came to understand that that is not what I want. After more research, I found that the initial oauth/authorize request should be sent as a direct request in the browser. My problem is I can't begin to visualize how this should be

Slack API Opening a New DM (Scopes and Permissions)

99封情书 提交于 2019-12-13 00:34:06
问题 I am attempting to open a DM (Direct Message) with an arbitrary user using the im.open Slack API call. I am sending it a user's user_id that I obtain through their clicking of a consent button in order to begin a series of questions. I am sending data to the Slack API successfully along with receiving data. I am getting the following response... { "ok": false, "error": "missing_scope", "needed": "im:write", "provided": "identify,incoming-webhook,chat:write:user,files:write:user", } I have