slack-api

Is it possible to use a file path instead of url as `image_url` when sending a message via Slack API or Incoming Webhook?

吃可爱长大的小学妹 提交于 2019-12-24 10:48:53
问题 Let's assume I have the following block which I want to send via Incoming Webhook to Slack { "type": "image", "title": { "type": "plain_text", "text": "foo bar" }, "image_url": "https://api.slack.com/img/blocks/example/beagle.png", "alt_text": "foo" } but instead of providing a http url as image_url I would like to provide a file path because the file I want to send is in the same folder as my script. 1) Is this possible? I guess no. 2) Is it possible to upload an image via files.upload in a

Slack bot doesn't interpret json message

旧街凉风 提交于 2019-12-24 10:02:17
问题 I have a problem with slack-azure integration. I am trying to build a bot using slash commands, which sends request to azure function. After the function execution I want to return results to a user. I am using JSON and simple return statement at the end of my function. The problem is that Slack doesn't interpret this json, but it treats it like the normal string and prints the raw json. I think that the json in written properly, because I tested it out in the Slack Block Kit Builder and sent

How to download files that were created by a slackbot?

╄→尐↘猪︶ㄣ 提交于 2019-12-24 08:25:09
问题 I created a bot which collects info from users in a workspace. It stores this info in a csv file on the local server. How do I download said file? I got this bit of code from Stack Overflow, attempted to contact the author but didn't get any response. import requests url = 'https://slack-files.com/T0JU09BGC-F0UD6SJ21-a762ad74d3' token = 'xoxp-TOKEN' requests.get(url, headers={'Authorization': 'Bearer %s' % token}) How do I obtain the URL & token of the file? What is the token? Is it the OAuth

Slack Send Direct Message to ALL on SLACK (Not group message I want to send individual message

独自空忆成欢 提交于 2019-12-24 07:50:01
问题 my question is whether Slack can Send Direct Message to ALL persons on my group on SLACK (Not group message I want to send an individual message 回答1: There is no API method for that, but you can create this functionality easily with a small script. Get all members of a Slack team incl. their user IDs with users.list Loop through all active users (ignore the ones with deleted = false ) Send a direct message to each user with chat.postMessage by using their user ID as channel Be sure though to

Slack: Bot name in sent messages

霸气de小男生 提交于 2019-12-24 06:43:39
问题 I created a bot named "esmeralda". When I send a message to Slack with the token generated for this esmeralda, the message just appears to be from "bot", not "esmeralda". Can I do something so that the message will be shown to be sent by "esmeralda" instead the "bot"? 回答1: I'm guessing you're using the Web API and therefore the chat.postMessage method? I'm further guessing that you're not passing as_user=true as one of your parameters. Try doing that. (If my guesses are wrong, please include

make Python 3.x Slack (slackclient) use a corporate proxy

北城以北 提交于 2019-12-24 04:26:27
问题 I have some Python 3 code and can make it use the module slackclient to post to channels, no problem. However if I run this code from our corporate servers where all traffic needs to go through a proxy it fails. I know the proxy server and port and have to use them to run pip from our servers, like this: pip install --proxy proxy.evilcorp.com:8080 slackclient That works great. If I don't proxy the pip, it fails to connect as expected. So that tells me I just need to figure out how to get my

How to display a greater-than symbol at the start of a Slack attachment line with markdown enabled?

人走茶凉 提交于 2019-12-24 02:25:48
问题 I am trying to match a mock-up of a Slack API message that has a greater-than (>) character in a link at the start of an attachment text line. The mock-up also uses italics and bold in the attachment text, so I have text in the mrkdown_in array. Unfortunately, this causes Slack to interpret > or > as a blockquote character when it occurs at the start of a line. Does anyone know how to work around this? I could use small greater-than (﹥) or full-width greater-than (>), but it seems silly that

Using the Slack API, how can I direct message all users at the same time?

巧了我就是萌 提交于 2019-12-24 01:17:05
问题 On Slack, I'm aware that using chat.postMessage allows me to message each user individually, but how would I go about direct messaging the entire team (400 members) at once? 回答1: Hello For that you need a channel with all 400 of them in it, cause currently you cannot send to 400 individual users. For sending message to a channel, you just need to add channel argument for postMessage method. Check this :: https://api.slack.com/methods/chat.postMessage 回答2: There is no "bulk" variant of chat

How to integrate AppHarbor with Slack?

十年热恋 提交于 2019-12-24 00:39:03
问题 There does't seem to be an official integration a.t.m. How can I do it manually? What I'm looking to achieve is: Every time the build goes from PASSED to FAILED, a (sad) message should be posted on Slack Every time the build goes from FAILED to PASSED, a different (happy!) message should be posted. 来源: https://stackoverflow.com/questions/28087223/how-to-integrate-appharbor-with-slack

connecting slack to botman in laravel on localhost

自作多情 提交于 2019-12-24 00:37:20
问题 This is my routes file in laravel. Am matching any url with /botman that calls a closure which, registers a slack driver for botman and listens to the message hello. In slack am trying to set the Request URL under event subscriptions using this http://127.0.0.1:8000/botman . I get "Your URL didn't respond with the value of the challenge parameter." . What am I missing? is it on my routes file? or the url? <?php use BotMan\BotMan\BotMan; use BotMan\BotMan\BotManFactory; use BotMan\Drivers