slack

Access Slack files from a slack bot

亡梦爱人 提交于 2020-01-12 12:51:53
问题 I need a slack bot that's able to receive and save files send from slack chatrooms. The problem is: slack doesn't send file contents, but an array of links pointing to the file. Most of them, including download link are private and cannot be accessed via bot. It does send one public link, but that link points at the file preview, which does not have the file itself (here's an example). So the question is: how can I access uploaded files via bot? 回答1: You can access private URLs from your bot

Slack Attachment Width and Wrapping Issues

半世苍凉 提交于 2020-01-12 02:41:44
问题 I'm trying to use slack attachments to log application errors but the large fields like the stack trace are behaving weirdly. First, when using attachments the table seems to be fixed to some arbitrary width, is there anyway to change this so a wider value can be allowed? Otherwise 50+% of the slack window is blank, a complete waste. Using just text works fine, but there are a number of other smaller fields included that benefit from the field format. Also I'm having a problem with slack

How to allow a slack post uploaded via curl to be editable by others

谁说我不能喝 提交于 2020-01-11 11:32:14
问题 I am using this curl request to upload a file: curl -s -F file=@%s -F channels=%s -F initial_comment=%s -F token=%s https://slack.com/api/files.upload' The idea is to have the file uploaded to a slack channel by a pipeline and have someone else edit the file. I can't seem to find the flag to allow a file uploaded by this method to be available for edit by others 回答1: I did some research on files.upload and my result is that it is not possible to upload a file in a way that would make it

How to allow a slack post uploaded via curl to be editable by others

十年热恋 提交于 2020-01-11 11:32:06
问题 I am using this curl request to upload a file: curl -s -F file=@%s -F channels=%s -F initial_comment=%s -F token=%s https://slack.com/api/files.upload' The idea is to have the file uploaded to a slack channel by a pipeline and have someone else edit the file. I can't seem to find the flag to allow a file uploaded by this method to be available for edit by others 回答1: I did some research on files.upload and my result is that it is not possible to upload a file in a way that would make it

How to mention @channel(All the team members) using slack api while post message

我与影子孤独终老i 提交于 2020-01-11 08:31:49
问题 I want to post a message in slack using api. How can I mention all the team members of a channel just like @channel in slack? 回答1: You can use <!channel> . Example You can see all the possible @mentions in Slack documentation under Variables 来源: https://stackoverflow.com/questions/36795403/how-to-mention-channelall-the-team-members-using-slack-api-while-post-message

Decoding body parameters with Spring

折月煮酒 提交于 2020-01-04 04:41:07
问题 I'm developing a REST API backend with Spring for a Slack App. I was able to receive messages from Slack (the slash commands) but I'm not able to properly receive component interactions (button clicks). The official documentation says: Your Action URL will receive a HTTP POST request, including a payload body parameter, itself containing an application/x-www-form-urlencoded JSON string. therefore I have written the following @RestController : @RequestMapping(method = RequestMethod.POST, value

Slack Webhook - Getting Invalid_Payload

邮差的信 提交于 2020-01-04 02:57:10
问题 I am attempting to set up a webhook to Slack, but am getting an Error message of "Invalid_Payload" I've looked through Stack, Slack, and Github... but cant' find the answer I seek. "CustomLink" in there for privacy, actual link is begin used. CODE: var request = require('request') var webhook = "https://hooks.slack.com/services/CUSTOMLINK" var payload={"text":"This is via an integration from Me - It is a test"} request.post({url: webhook, payload: payload}, function(err, res){ if(err){console

Jenkins Pipeline currentBuild duration time returns always 0

吃可爱长大的小学妹 提交于 2020-01-02 08:50:11
问题 I am trying to get build duration for our report but it always returns 0. From reading docs, going through Slack plugin source and reading other resources I should be able to do one of the following: def duration = currentBuild.duration def duration = currentBuild.durationString def duration = currentBuild.durationString() def duration = currentBuild.getDurationString() none of which works. From my understanding this might be because I am calling this before the build actually finished and so

Groovy script fails to call Slack notification parameter from Jenkins DSL job

。_饼干妹妹 提交于 2020-01-01 18:31:31
问题 I'm attempting to use the Jenkins Job DSL plugin for the first time to create some basic job "templates" before getting into more complex stuff. Jenkins is running on a Windows 2012 server. The Jenkins version is 1.650 and we are using the Job DSL plugin version 1.51. Ideally what I would like is for the seed job to be parameterised so that when it is being run the user can enter four things: the Job DSL script location, the name of the generated job, a Slack channel for failure notifications

Can a Slack bot get the thread id that a slash command was sent from?

天涯浪子 提交于 2020-01-01 14:12:50
问题 Suppose a user types a slash command inside a thread, as opposed to inside the main channel. Is it possible for to include this information in the request sent to the bot? I want the bot to know where exactly the message came from so that it can reply in the same location (i.e. inside the thread and not in the main channel) Judging by the docs, it seems information about threads is not sent. Here is the POST object that the docs say is sent: token=gIkuvaNzQIHg97ATvDxqgjtO &team_id=T0001 &team