slack-api

Slack DM to a user not in `im.list`

匆匆过客 提交于 2019-12-05 07:38:34
I'm implementing a slack ops bot that will notify users of job completion on a build server. It needs to be able to DM users on job completion. I've setup a bot user as per the instructions @ https://api.slack.com/bot-users . To send a DM to a particular user, chat.postMessage takes the first argument (channel) as either a @username or a IM channel's ID as per the documentation @ https://api.slack.com/methods/chat.postMessage#channels . To get the IM channel ID of a user, im.list can be used. But im.list only gives the IM channel IDs of the users the bot has previously interacted with (or the

How do I set a reminder via the Slack API?

给你一囗甜甜゛ 提交于 2019-12-05 05:58:20
I'd like to be able to create messages that use the /remind slash command in Slack via an API (probably either with an incoming webhook or the web API . When I post a message via the web API, however, the command just comes through like a "regular" message, for example, /remind me in 1 month to follow up with the Boss — it doesn't trigger an actual reminder. Is there a way to set a reminder (or, more generally, use slash commands) programmatically in Slack? Vikram Bodicherla It looks like it was added recently to the API: https://api.slack.com/methods/reminders.add Seems that Slack is not

Slack Event API for Bot Mentions

巧了我就是萌 提交于 2019-12-04 17:32:03
I'm building a Slack bot using a Slack App. I have managed to authorise and am successfully receiving events via the Event API. I'm trying to find out how to listen only for direct mentions of the bot. Therefore it should fire an event when someone messages a public or private channel AND when the bot is directly tagged like @bot Public/private Slack Channel Example: Daniel: Hi there bot (does not trigger) Jeremy: @bot hi there (triggers Event API) Is there a Slack Event that does this? Or is there another way to do this? I don't want to have to hardcode it into my server-side application as

How to scale a slack bot to 1000's of teams

旧巷老猫 提交于 2019-12-04 09:19:15
问题 To implement a slack bot, i need to deal with 'Real Time Messaging API' of slack. It is a WebSocket-based API that allows you to receive events from Slack in real time and send messages as user. more info: https://api.slack.com/rtm To create a bot for only one team , i need to open one websocket connection and listen it for events. To make available the slack bot for another team. I need to open a new websocket connection. So, 1 team => 1 websocket connection 2 teams => 2 websocket

Formatting posts with the Slack api

删除回忆录丶 提交于 2019-12-04 02:01:53
问题 I'm trying to create Posts with botkit using the Slack api, but I can't find any documentation on how to format a Post file in Slack. bot.api.files.upload({ content: "# Heading", filename: "test.md", filetype: "post", channels: "random" }); Markdown formatting doesn't work for this, is there any syntax to formatting Slack Posts? Trying with HTML the response from the created file is like this: <document><p><document><h1>H1<\/h1><p><\/p><h2>H2<\/h2><p><\/p><h3>H3<\/h3><p><\/p><p>Text <i>italic

How to make a list of failed specs using jasmine custom reporter to post to slack?

帅比萌擦擦* 提交于 2019-12-03 16:23:27
I am trying to work on a custom jasmine reporter and get a list of all the failed specs in the specDone function: specDone: function(result) { if(result.status == 'failed') { failedExpectations.push(result.fullName); console.log(failedExpectations); } } where failedExpectations will store an entire list of the failed specs and i need to access this in the afterLaunch function in the protractor config file. But due to the fact that the config file loads everytime a new spec runs it basically gets overwritten and scoping is such that I cannot access it in the afterLaunch function, that is where

Jenkins Slack integration

橙三吉。 提交于 2019-12-03 15:03:31
问题 I want to use the Slack plugin in Jenkins to ping notifications to a Slack channel. Jenkins says success when I test the connection, but I don't receive any notifications in my Slack channel. Are there any known problems? How can I get Jenkins to send notifications to Slack? 回答1: And are you sure that you have a correct configuration. In Build Configuration (Do not forget # character) In General Configuration 回答2: I think that you should add post-build action "Slack Notification" in your

How to upload files to slack using file.upload and requests

梦想与她 提交于 2019-12-03 13:46:44
问题 I've been searching a lot and I haven't found an answer to what I'm looking for. I'm trying to upload a file from /tmp to slack using python requests but I keep getting {"ok":false,"error":"no_file_data"} returned. file={'file':('/tmp/myfile.pdf', open('/tmp/myfile.pdf', 'rb'), 'pdf')} payload={ "filename":"myfile.pdf", "token":token, "channels":['#random'], "media":file } r=requests.post("https://slack.com/api/files.upload", params=payload) Mostly trying to follow the advice posted here 回答1:

Is it possible to post files to Slack using the incoming Webhook?

痞子三分冷 提交于 2019-12-03 11:39:38
问题 I am trying out the Slack's API using the incoming webhook feature, posting messages works flawlessly, but it doesn't seem to allow any file attachments. Looking through I understand I have to use a completely different OAuth based API, but creating more tokens just for the purpose of uploading a file seems odd when posting messages works well, is there no way to upload files to slack with the incoming webook? 回答1: No, its is not possible to upload files through an incoming Webhook. But you

How to access Junit test counts in Jenkins Pipeline project

风格不统一 提交于 2019-12-03 06:38:48
问题 I have just started with Jenkins My freestyle project used to report JUnit tests results in Slack like this MyJenkinsFreestyle - #79 Unstable after 4 min 59 sec (Open) Test Status: Passed: 2482, Failed: 13, Skipped: 62 Now I have moved the same to pipeline project, and all is good except that Slack notifications do not have Test Status done MyPipelineProject #68 UNSTABLE I understand I have to construct the message to send to Slack, and I have done that above for now. The only issue is how do