slack

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

社会主义新天地 提交于 2020-01-01 14:11:44
问题 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

generate SLACK_APP_TOKEN for slack application

喜欢而已 提交于 2019-12-31 03:38:28
问题 let's say I've created slack app and I have client id and secret. What is the easiest way to get SLACK_APP_TOKEN in my hands that will be able to create channel? 回答1: If you want a proper access token that is related to your Slack App the only way to get it is to install your Slack app with the OAuth process as described here in the Slack documentation. You will need a mini website with a script (e.g. PHP) to perform the installation. The so called test token will also allow you use the Slack

slack incoming webhook - send message to another channel

人盡茶涼 提交于 2019-12-31 02:01:44
问题 I am trying to post message to any channel in a slack team. My webhook has been properly created and installed into my test team. As part of the install process, I selected " Post to #channel1 " When I review permissions, I see my app has been granted Other/Post to specific channels in Slack (#channel1). From there, I am able to post into #channel1 with a basic JSON request: { "text":"Hello, World!" } Now I want to validate I can use same webhook to post to any other channel of the same team.

How can I share my slack app between my workspaces?

拥有回忆 提交于 2019-12-29 08:45:10
问题 I've just created an app (slash command) and install it in one of my workspaces. But now I want to add the same app to another one. Is it possible without distribution to App Directory? 回答1: If you want to add you Slack app to another workspace, you can do so without going through the process of placing it on the App directory. All you need to do is add the ability to install your app to an workspace using OAuth 2.0. enable public distribution So instead of clicking "Install app to this

Slack incoming webhook: Request header field Content-type is not allowed by Access-Control-Allow-Headers in preflight response

对着背影说爱祢 提交于 2019-12-28 06:00:30
问题 I try to post a slack message via the fetch API in a browser: fetch('https://hooks.slack.com/services/xxx/xxx/xx', { method: 'post', headers: { 'Accept': 'application/json, text/plain, */*', 'Content-type': 'application/json' }, body: JSON.stringify({text: 'Hi there'}) }) .then(response => console.log) .catch(error => console.error); }; I get the following error message: Fetch API cannot load: https://hooks.slack.com/services/xxxxxxx/xxxxx. Request header field Content-type is not allowed by

How to integrate internal APIs (Not accessible outside office network) to slack slash commands

允我心安 提交于 2019-12-28 04:33:16
问题 I am trying to use slash commands to my one of the slack channel. I tried to do a POC using git API and it worked fine. I first created a slash command from this link : https://api.slack.com/censored/slash-commands Commnad: /poc Request URL: http://jsonplaceholder.typicode.com/posts This worked fine when I type /opc on slack chat box of my channel. It returns some data. But when I change the Request URL to an internal API, which is accessible only from the office domain, I get error: Darn –

How to configure slash command response to entire channel?

我与影子孤独终老i 提交于 2019-12-25 14:01:18
问题 I'm currently using the "Isitup" slack slash command example authored by David McCreath (more here": https://github.com/mccreath/isitup-for-slack/blob/master/isitup.php). Within this code, I am wondering how I would go about making the response go from appearing "only to me" to posting in to the entire channel, along with the query posted by the user. I've read the slack documentation which shows the "in_channel" parameter that needs to be added, however I am just not that strong with code so

How to configure slash command response to entire channel?

∥☆過路亽.° 提交于 2019-12-25 14:00:27
问题 I'm currently using the "Isitup" slack slash command example authored by David McCreath (more here": https://github.com/mccreath/isitup-for-slack/blob/master/isitup.php). Within this code, I am wondering how I would go about making the response go from appearing "only to me" to posting in to the entire channel, along with the query posted by the user. I've read the slack documentation which shows the "in_channel" parameter that needs to be added, however I am just not that strong with code so

Wordpress Post Notification with full HTML via Slack

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-25 00:04:39
问题 When I create a post in Wordpress a slack notification plugin sends notifications to a channel using the slack api. The notification works fine. What I'm trying to do is to the send the content of the post to the channel including the formatting and HTML. I can easily get the content to post to the channel, but I'm struggling to get the content to be formatted. This may be a Slack issue, but I'm not sure. Here's the code. `$message = apply_filters('the_content',$post->post_content);` I'm not

How to get a workspace agnostic Slack bot token?

无人久伴 提交于 2019-12-24 15:45:54
问题 I'm trying to create a bot that people can install in their workspaces and send/receive messages of some sort. The problem I'm running into is the documentation tells you to use the token generated for your workspace: https://api.slack.com/bot-users#installing-bot But this makes no sense, seeing as people would be installing the App/Bot on their workspace themselves, it's not like they would be giving me their token or anything. Surely I'm missing something. How am I meant to authenticate a